Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a diagnostic message rather than segfaulting on a closure having …
…a missing outer context pointer.
  • Loading branch information
jnthn committed Mar 1, 2012
1 parent 47ed8e9 commit bd82150
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/6model/serialization.c
Expand Up @@ -347,6 +347,10 @@ static Parrot_Int4 get_serialized_context_idx(PARROT_INTERP, SerializationWriter
static Parrot_Int4 get_serialized_outer_context_idx(PARROT_INTERP, SerializationWriter *writer, PMC *closure) {
if (!PMC_IS_NULL(VTABLE_getprop(interp, closure, Parrot_str_new_constant(interp, "COMPILER_STUB"))))
return 0;
if (PMC_IS_NULL(PARROT_SUB(closure)->outer_ctx))
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Serialization Error: missing outer context for closure '%Ss'",
VTABLE_get_string(interp, closure));
return get_serialized_context_idx(interp, writer, PARROT_SUB(closure)->outer_ctx);
}

Expand Down

0 comments on commit bd82150

Please sign in to comment.