Skip to content

Commit 9acb660

Browse files
committed
Improved diagnostics for Parrot Object types sneaking into places that need serialization.
1 parent 600a772 commit 9acb660

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/6model/serialization.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,11 @@ void write_ref_func(PARROT_INTERP, SerializationWriter *writer, PMC *ref) {
448448
discrim = REFVAR_CLONED_CODEREF;
449449
}
450450
}
451+
else if (ref->vtable->base_type == enum_class_Object) {
452+
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
453+
"Serialization Error: Parrot object type '%Ss' passed to write_ref",
454+
VTABLE_name(interp, VTABLE_get_class(interp, ref)));
455+
}
451456
else {
452457
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
453458
"Serialization Error: Unimplemented object type '%Ss' passed to write_ref",

0 commit comments

Comments
 (0)