File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,13 @@ case MAYBE_LONG_ADD + DTREE_OP_SLOT_READ: {
126126 DTILOG (" location: %s name: %s\n " , _safe_rep_ (location), _safe_rep_ (slot_name));
127127 size_t index = location.unsafe_fixnum ();
128128 DTILOG (" Got tinstance@%p %s\n " , (void *)arg.raw_ (), _safe_rep_ (arg));
129- Instance_sp instance = gc::As_assert<Instance_sp>(arg);
129+
130+ #ifdef DEBUG_ASSERT
131+ if (!(gc::IsA<Instance_sp>(arg) || gc::IsA<FuncallableInstance_sp>(arg))) {
132+ THROW_HARD_ERROR (" arg = {} must be an Instance_sp or FuncallableInstance_sp" ,(void *)arg.raw_ ());
133+ }
134+ #endif
135+ Instance_sp instance = gc::As_unsafe<Instance_sp>(arg);
130136 DTILOG (" instance %p index %lu\n " , (void *)instance.raw_ (), index);
131137 T_sp value = instance->instanceRef (index);
132138 if (value.unboundp ()) {
You can’t perform that action at this time.
0 commit comments