Cache references when marshalling abstract types.

This commit is contained in:
Calvin Rose 2023-07-01 18:02:56 -05:00
parent edf263bcb5
commit db0abfde72
1 changed files with 2 additions and 1 deletions

View File

@ -422,7 +422,7 @@ static void marshal_one_abstract(MarshalState *st, Janet x, int flags) {
marshal_one(st, janet_csymbolv(at->name), flags + 1);
JanetMarshalContext context = {st, NULL, flags, NULL, at};
at->marshal(abstract, &context);
//MARK_SEEN();
MARK_SEEN();
} else {
janet_panicf("cannot marshal %p", x);
}
@ -1233,6 +1233,7 @@ static const uint8_t *unmarshal_one_abstract(UnmarshalState *st, const uint8_t *
if (context.at != NULL) {
janet_panic("janet_unmarshal_abstract not called");
}
janet_v_push(st->lookup, *out);
return context.data;
}
janet_panic("invalid abstract type - no unmarshal function pointer");