1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

scm_gc_malloc: Handle zero-octet allocations.

* libguile/gc-malloc.c (scm_gc_malloc): Pass a non-zero size to
  `GC_MALLOC ()' when SIZE is zero.

git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-2
This commit is contained in:
Ludovic Courtes 2007-02-18 13:55:40 +00:00 committed by Ludovic Courtès
parent 4a4849dbe0
commit ea4f8ea13f

View file

@ -209,7 +209,14 @@ scm_gc_malloc (size_t size, const char *what)
to write it the program is killed with signal 11. --hwn
*/
void *ptr = GC_MALLOC (size);
void *ptr;
if (size == 0)
/* `GC_MALLOC ()' doesn't handle zero. */
size = sizeof (void *);
ptr = GC_MALLOC (size);
return ptr;
}