Branch: Tag:

2005-05-17

2005-05-17 21:44:30 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Reference count bugfix in modify_shared_string().

Rev: src/stralloc.c:1.199

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: stralloc.c,v 1.198 2005/04/02 15:04:03 mast Exp $ + || $Id: stralloc.c,v 1.199 2005/05/17 21:44:30 grubba Exp $   */      #include "global.h"
1651:    if((((unsigned int)index) >= HASH_PREFIX) && (index < a->len-8))    {    struct pike_string *old; +  if (wrong_hash(a)) { +  Pike_fatal("Broken hash optimization.\n"); +  }    /* Doesn't change hash value - sneak it in there */    old = internal_findstring(a->str, a->len, a->size_shift, a->hval);    if (old) {
1659:    add_ref(a = old);    } else {    link_pike_string(a, a->hval); +  add_ref(a);    }    }else{    a = end_shared_string(a);