Mercurial > hg > xemacs-beta
changeset 4776:73e8632018ad
Don't attempt to free dumped data, alloc.c:resize_string()
2009-12-17 Aidan Kehoe <kehoea@parhasard.net>
* alloc.c (resize_string):
Don't attempt to free dumped data in this function, avoiding an
assertion failure.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 17 Dec 2009 13:15:04 +0000 |
parents | 1d61580e0cf7 |
children | c69aeb86b2a3 |
files | src/ChangeLog src/alloc.c |
diffstat | 2 files changed, 20 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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 <kehoea@parhasard.net> + + * alloc.c (resize_string): + Don't attempt to free dumped data in this function, avoiding an + assertion failure. + 2009-12-13 Stephen J. Turnbull <stephen@xemacs.org> * unicode.c (unicode_query): Add missing return type.
--- 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 */