1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

(scm_must_realloc): bugfix: do mtrigger before

realloc. Thanks to Sam Hocevar for reporting this bug
This commit is contained in:
Han-Wen Nienhuys 2003-07-17 11:19:16 +00:00
parent c6d31743c5
commit 5a6432a012
4 changed files with 18 additions and 1 deletions

6
NEWS
View file

@ -16,6 +16,12 @@ Changes since Guile 1.6.4 (i.e. changes for 1.6.5):
* Changes to the distribution
* Changes to the stand-alone interpreter
** GC bug fixed.
The use of scm_must_realloc() for memory which is scanned by GC, could
trigger a GC scan of a free()d block of memory. This is now fixed.
* Changes to Scheme functions and syntax
** SRFI-1 delete equality argument order fixed.

1
THANKS
View file

@ -46,6 +46,7 @@ For fixes or providing information which led to a fix:
Eric Hanchrow
Utz-Uwe Haus
Karl M. Hegbloom
Sam Hocevar
Anders Holst
Stefan Jahn
Steven G. Johnson

View file

@ -1,3 +1,8 @@
2003-07-17 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* gc.c (scm_must_realloc): bugfix: do mtrigger before
realloc. Thanks to Sam Hocevar for reporting this bug
2003-06-10 Marius Vollmer <mvo@zagadka.de>
* gc_os_dep.c (scm_get_stack_base): New version using

View file

@ -2051,10 +2051,15 @@ scm_must_realloc (void *where,
scm_must_free() won't take NULL.
*/
scm_mallocated += size - old_size;
SCM_SYSCALL (ptr = realloc (where, size));
/*
The realloc must be after check_mtrigger(), since realloc might
munge the old block of memory, which will be scanned by GC.
*/
check_mtrigger (what);
SCM_SYSCALL (ptr = realloc (where, size));
if (NULL != ptr)
{
#ifdef GUILE_DEBUG_MALLOC