mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 16:20:17 +02:00
initialize 'u' slots to 0, not SCM_UNPACK(SCM_GOOPS_UNBOUND)
* goops.c (wrap_init): Initialize 'u' slots to 0, not some random SCM value.
This commit is contained in:
parent
d5afe07f3b
commit
597618822f
2 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
||||||
2008-04-10 Andy Wingo <wingo@pobox.com>
|
2008-04-10 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
* libguile/goops.c (get_slot_value, set_slot_value): In the struct
|
* goops.c (wrap_init): Initialize 'u' slots to 0, not some random
|
||||||
|
SCM value.
|
||||||
|
|
||||||
|
* goops.c (get_slot_value, set_slot_value): In the struct
|
||||||
allocation case, don't poke the slots array directly -- we should
|
allocation case, don't poke the slots array directly -- we should
|
||||||
go through struct-ref/struct-set! code so that we get the
|
go through struct-ref/struct-set! code so that we get the
|
||||||
permissions and allocation ('u' versus 'p') correct.
|
permissions and allocation ('u' versus 'p') correct.
|
||||||
|
|
|
@ -1507,10 +1507,15 @@ static SCM
|
||||||
wrap_init (SCM class, SCM *m, long n)
|
wrap_init (SCM class, SCM *m, long n)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
|
scm_t_bits slayout = SCM_STRUCT_DATA (class)[scm_vtable_index_layout];
|
||||||
|
const char *layout = scm_i_symbol_chars (SCM_PACK (slayout));
|
||||||
|
|
||||||
/* Set all slots to unbound */
|
/* Set all SCM-holding slots to unbound */
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
|
if (layout[i*2] == 'p')
|
||||||
m[i] = SCM_GOOPS_UNBOUND;
|
m[i] = SCM_GOOPS_UNBOUND;
|
||||||
|
else
|
||||||
|
m[i] = 0;
|
||||||
|
|
||||||
return scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class))
|
return scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class))
|
||||||
| scm_tc3_struct),
|
| scm_tc3_struct),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue