# HG changeset patch # User Aidan Kehoe # Date 1261055704 0 # Node ID 73e8632018ad325c53e257bd721810f426eea87a # Parent 1d61580e0cf7e5d11f4f06d9e7e185bda6d92805 Don't attempt to free dumped data, alloc.c:resize_string() 2009-12-17 Aidan Kehoe * alloc.c (resize_string): Don't attempt to free dumped data in this function, avoiding an assertion failure. diff -r 1d61580e0cf7 -r 73e8632018ad src/ChangeLog --- a/src/ChangeLog Thu Dec 17 12:57:38 2009 +0000 +++ b/src/ChangeLog Thu Dec 17 13:15:04 2009 +0000 @@ -1,3 +1,9 @@ +2009-12-17 Aidan Kehoe + + * alloc.c (resize_string): + Don't attempt to free dumped data in this function, avoiding an + assertion failure. + 2009-12-13 Stephen J. Turnbull * unicode.c (unicode_query): Add missing return type. diff -r 1d61580e0cf7 -r 73e8632018ad src/alloc.c --- a/src/alloc.c Thu Dec 17 12:57:38 2009 +0000 +++ b/src/alloc.c Thu Dec 17 13:15:04 2009 +0000 @@ -2690,19 +2690,20 @@ } XSET_STRING_DATA (s, new_data); - { - /* We need to mark this chunk of the string_chars_block - as unused so that compact_string_chars() doesn't - freak. */ - struct string_chars *old_s_chars = (struct string_chars *) - ((char *) old_data - offsetof (struct string_chars, chars)); - /* Sanity check to make sure we aren't hosed by strange - alignment/padding. */ - assert (old_s_chars->string == XSTRING (s)); - MARK_STRING_CHARS_AS_FREE (old_s_chars); - ((struct unused_string_chars *) old_s_chars)->fullsize = - oldfullsize; - } + if (!DUMPEDP (old_data)) /* Can't free dumped data. */ + { + /* We need to mark this chunk of the string_chars_block + as unused so that compact_string_chars() doesn't + freak. */ + struct string_chars *old_s_chars = (struct string_chars *) + ((char *) old_data - offsetof (struct string_chars, chars)); + /* Sanity check to make sure we aren't hosed by strange + alignment/padding. */ + assert (old_s_chars->string == XSTRING (s)); + MARK_STRING_CHARS_AS_FREE (old_s_chars); + ((struct unused_string_chars *) old_s_chars)->fullsize = + oldfullsize; + } } } #endif /* not NEW_GC */