Skip to content

Commit

Permalink
When chasing the outer chain serializing closures, we may encounter a…
Browse files Browse the repository at this point in the history
… NULL lexinfo pointer. Don't follow it.
  • Loading branch information
jnthn committed Apr 20, 2012
1 parent e5e2dea commit 1e988f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/6model/serialization.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ static void write_code_ref(PARROT_INTERP, SerializationWriter *writer, PMC *code
static PMC * closure_to_static_code_ref(PARROT_INTERP, PMC *closure, INTVAL fatal) {
/* Look up the static lexical info. */
PMC *lexinfo = PARROT_SUB(closure)->lex_info;
if (lexinfo == NULL) {
if (fatal)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Serialization Error: NULL lexical info for closure '%Ss'",
VTABLE_get_string(interp, closure));
else
return PMCNULL;
}
if (lexinfo->vtable->base_type == nqp_lexpad_id || lexinfo->vtable->base_type == perl6_lexpad_id) {
PMC *static_code = PARROT_NQPLEXINFO(lexinfo)->static_code;
if (PMC_IS_NULL(static_code))
Expand Down

0 comments on commit 1e988f1

Please sign in to comment.