Closed jpellegrini closed 5 months ago
But it's still strange that it segfaults without this patch.
DEFINE_PRIMITIVE("class-of", class_of, subr1, (SCM obj))
{
...
if (HAS_USER_TYPEP(obj)) {
SCM tmp = STk_extended_class_of(obj);
if (tmp) return tmp;
}
...
return UnknownClass;
}
So it should return UnknownClass
.
Anyway, the patch seems to work well for bitvectors.
But it's still strange that it segfaults without this patch.
DEFINE_PRIMITIVE("class-of", class_of, subr1, (SCM obj)) { ... if (HAS_USER_TYPEP(obj)) { SCM tmp = STk_extended_class_of(obj); if (tmp) return tmp; } ... return UnknownClass; }
So it should return
UnknownClass
.Anyway, the patch seems to work well for bitvectors.
This is my fault. I have extended STk_extended_class_of
: we can now have a class or a function which returns a class. I forgot to test if the value is NULL
. I correct this immediately and I'll merge your PR.
Thanks for seeing this @jpellegrini .
This is because
#*11
is of a type which is only defined insrfi-178.c
, andobject.c
can't tell what it is.We do as we did in SRFI 25, and customize
class-of
anddescribe
for bitvectors.