Skip to content

Commit bbe37f3

Browse files
committed
Ensure that when a type object is cloned, we don't lose the type object flag.
1 parent d7cec32 commit bbe37f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/6model/reprs/P6opaque.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,16 @@ static PMC * repr_clone(PARROT_INTERP, PMC *to_clone) {
598598
if (defined(interp, to_clone)) {
599599
obj = (P6opaqueInstance *)Parrot_gc_allocate_fixed_size_storage(interp, repr_data->allocation_size);
600600
memcpy(obj, PMC_data(to_clone), repr_data->allocation_size);
601+
return wrap_object(interp, obj);
601602
}
602603
else {
604+
PMC *result;
603605
obj = mem_allocate_zeroed_typed(P6opaqueInstance);
604606
memcpy(obj, PMC_data(to_clone), sizeof(P6opaqueInstance));
607+
result = wrap_object(interp, obj);
608+
PObj_flag_SET(private0, result);
609+
return result;
605610
}
606-
607-
return wrap_object(interp, obj);
608611
}
609612

610613
/* Used with boxing. Sets an integer value, for representations that can hold

0 commit comments

Comments
 (0)