summaryrefslogtreecommitdiff
path: root/libguile/goops.c
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2009-01-04 21:32:23 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2009-01-04 22:46:47 +0000
commita9931e4e1ab80e6b47d6d836edf834f530bd9522 (patch)
tree071b6725354a340680267644936503743e2fa3c0 /libguile/goops.c
parent53e4bd36f3c8fc756fc091891b79e6aa16820256 (diff)
downloadguile-a9931e4e1ab80e6b47d6d836edf834f530bd9522.tar.gz
Fix implementation of %fast-slot-ref and %fast-slot-set!
* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x): Correct incantation for getting the number of slots of the specified instance. * libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong). * test-suite/standalone/test-fast-slot-ref.in: New standalone test. * configure.in: Generate test-suite/standalone/test-fast-slot-ref. * test-suite/standalone/Makefile.am (check_SCRIPTS): Add test-fast-slot-ref.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r--libguile/goops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index 840ddd694..b3dfe0d69 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1218,7 +1218,10 @@ SCM_DEFINE (scm_sys_fast_slot_ref, "%fast-slot-ref", 2, 0, 0,
unsigned long int i;
SCM_VALIDATE_INSTANCE (1, obj);
- i = scm_to_unsigned_integer (index, 0, SCM_NUMBER_OF_SLOTS(obj)-1);
+ i = scm_to_unsigned_integer (index, 0,
+ SCM_I_INUM (SCM_SLOT (SCM_CLASS_OF (obj),
+ scm_si_nfields))
+ - 1);
return SCM_SLOT (obj, i);
}
#undef FUNC_NAME
@@ -1232,7 +1235,10 @@ SCM_DEFINE (scm_sys_fast_slot_set_x, "%fast-slot-set!", 3, 0, 0,
unsigned long int i;
SCM_VALIDATE_INSTANCE (1, obj);
- i = scm_to_unsigned_integer (index, 0, SCM_NUMBER_OF_SLOTS(obj)-1);
+ i = scm_to_unsigned_integer (index, 0,
+ SCM_I_INUM (SCM_SLOT (SCM_CLASS_OF (obj),
+ scm_si_nfields))
+ - 1);
SCM_SET_SLOT (obj, i, value);