1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Fix incorrect allocation size in 'make-vtable-vtable'.

Fixes <https://bugs.gnu.org/39266>.
Thanks to <https://rr-project.org/> for its help!

* libguile/struct.c (set_vtable_access_fields): Fix first argument to
'scm_gc_malloc_pointerless'.
This commit is contained in:
Ludovic Courtès 2020-03-09 15:09:26 +01:00
parent c01a81e8a2
commit 7c17655cd3

View file

@ -1,4 +1,4 @@
/* Copyright 1996-2001,2003-2004,2006-2013,2015,2017-2018
/* Copyright 1996-2001,2003-2004,2006-2013,2015,2017-2018,2020
Free Software Foundation, Inc.
This file is part of Guile.
@ -139,8 +139,10 @@ set_vtable_access_fields (SCM vtable)
nfields = len / 2;
bitmask_size = (nfields + 31U) / 32U;
unboxed_fields = scm_gc_malloc_pointerless (bitmask_size, "unboxed fields");
memset (unboxed_fields, 0, bitmask_size * sizeof(*unboxed_fields));
unboxed_fields =
scm_gc_malloc_pointerless (bitmask_size * sizeof (*unboxed_fields),
"unboxed fields");
memset (unboxed_fields, 0, bitmask_size * sizeof (*unboxed_fields));
/* Update FLAGS according to LAYOUT. */
for (field = 0; field < nfields; field++)