Skip to content

Commit 5fb6da3

Browse files
committed
Look for COMPILER_STUB marker and, if seen, don't serialize outer.
1 parent 9acb660 commit 5fb6da3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/6model/serialization.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ static PMC * closure_to_static_code_ref(PARROT_INTERP, PMC *closure, INTVAL fata
311311
Parrot_Int4 get_serialized_outer_context_idx(PARROT_INTERP, SerializationWriter *writer, PMC *closure) {
312312
PMC *outer_ctx = PARROT_SUB(closure)->outer_ctx;
313313
PMC *ctx_sc = VTABLE_getprop(interp, outer_ctx, Parrot_str_new_constant(interp, "SC"));
314+
if (!PMC_IS_NULL(VTABLE_getprop(interp, closure, Parrot_str_new_constant(interp, "COMPILER_STUB")))) {
315+
return 0;
316+
}
314317
if (PMC_IS_NULL(ctx_sc)) {
315318
/* Make sure we should chase a level down. */
316319
if (PMC_IS_NULL(closure_to_static_code_ref(interp, PARROT_CALLCONTEXT(outer_ctx)->current_sub, 0))) {
@@ -320,6 +323,9 @@ Parrot_Int4 get_serialized_outer_context_idx(PARROT_INTERP, SerializationWriter
320323
INTVAL idx = VTABLE_elements(interp, writer->contexts_list);
321324
VTABLE_set_pmc_keyed_int(interp, writer->contexts_list, idx, outer_ctx);
322325
VTABLE_setprop(interp, outer_ctx, Parrot_str_new_constant(interp, "SC"), writer->root.sc);
326+
printf("Added context with %s due to %s\n",
327+
Parrot_str_cstring(interp, VTABLE_get_string(interp, PARROT_CALLCONTEXT(outer_ctx)->current_sub)),
328+
Parrot_str_cstring(interp, VTABLE_get_string(interp, closure)));
323329
return (Parrot_Int4)idx + 1;
324330
}
325331
}

0 commit comments

Comments
 (0)