@@ -311,6 +311,9 @@ static PMC * closure_to_static_code_ref(PARROT_INTERP, PMC *closure, INTVAL fata
311
311
Parrot_Int4 get_serialized_outer_context_idx (PARROT_INTERP , SerializationWriter * writer , PMC * closure ) {
312
312
PMC * outer_ctx = PARROT_SUB (closure )-> outer_ctx ;
313
313
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
+ }
314
317
if (PMC_IS_NULL (ctx_sc )) {
315
318
/* Make sure we should chase a level down. */
316
319
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
320
323
INTVAL idx = VTABLE_elements (interp , writer -> contexts_list );
321
324
VTABLE_set_pmc_keyed_int (interp , writer -> contexts_list , idx , outer_ctx );
322
325
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 )));
323
329
return (Parrot_Int4 )idx + 1 ;
324
330
}
325
331
}
0 commit comments