1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-06 15:40:29 +02:00

Reduce some errors under -DSCM_DEBUG=1.

* goops.c (scm_sys_modify_instance, scm_sys_modify_class): Use
SCM_{,SET_}CELL_WORD_[01] instead of SCM_{,SET}C[AD]R since the
objects passed are not pairs.
This commit is contained in:
Ken Raeburn 2009-10-23 14:00:19 -04:00
parent 4d3406a847
commit 32b12f4050

View file

@ -1650,12 +1650,13 @@ SCM_DEFINE (scm_sys_modify_instance, "%modify-instance", 2, 0, 0,
*/ */
SCM_CRITICAL_SECTION_START; SCM_CRITICAL_SECTION_START;
{ {
SCM car = SCM_CAR (old); scm_t_bits word0, word1;
SCM cdr = SCM_CDR (old); word0 = SCM_CELL_WORD_0 (old);
SCM_SETCAR (old, SCM_CAR (new)); word1 = SCM_CELL_WORD_1 (old);
SCM_SETCDR (old, SCM_CDR (new)); SCM_SET_CELL_WORD_0 (old, SCM_CELL_WORD_0 (new));
SCM_SETCAR (new, car); SCM_SET_CELL_WORD_1 (old, SCM_CELL_WORD_1 (new));
SCM_SETCDR (new, cdr); SCM_SET_CELL_WORD_0 (new, word0);
SCM_SET_CELL_WORD_1 (new, word1);
} }
SCM_CRITICAL_SECTION_END; SCM_CRITICAL_SECTION_END;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -1672,13 +1673,14 @@ SCM_DEFINE (scm_sys_modify_class, "%modify-class", 2, 0, 0,
SCM_CRITICAL_SECTION_START; SCM_CRITICAL_SECTION_START;
{ {
SCM car = SCM_CAR (old); scm_t_bits word0, word1;
SCM cdr = SCM_CDR (old); word0 = SCM_CELL_WORD_0 (old);
SCM_SETCAR (old, SCM_CAR (new)); word1 = SCM_CELL_WORD_1 (old);
SCM_SETCDR (old, SCM_CDR (new)); SCM_SET_CELL_WORD_0 (old, SCM_CELL_WORD_0 (new));
SCM_SET_CELL_WORD_1 (old, SCM_CELL_WORD_1 (new));
SCM_STRUCT_DATA (old)[scm_vtable_index_vtable] = SCM_UNPACK (old); SCM_STRUCT_DATA (old)[scm_vtable_index_vtable] = SCM_UNPACK (old);
SCM_SETCAR (new, car); SCM_SET_CELL_WORD_0 (new, word0);
SCM_SETCDR (new, cdr); SCM_SET_CELL_WORD_1 (new, word1);
SCM_STRUCT_DATA (new)[scm_vtable_index_vtable] = SCM_UNPACK (new); SCM_STRUCT_DATA (new)[scm_vtable_index_vtable] = SCM_UNPACK (new);
} }
SCM_CRITICAL_SECTION_END; SCM_CRITICAL_SECTION_END;