Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add sanity check to avoid segfault.
  • Loading branch information
jnthn committed Jan 14, 2014
1 parent 006e107 commit d09f92d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm/moar/ops/perl6_ops.c
Expand Up @@ -435,6 +435,8 @@ static void p6getouterctx(MVMThreadContext *tc) {
MVMObject *vm_code_obj = MVM_frame_find_invokee(tc, p6_code_obj, NULL);
MVMFrame *outer = ((MVMCode *)vm_code_obj)->body.outer;
MVMObject *ctx = MVM_repr_alloc_init(tc, tc->instance->boot_types.BOOTContext);
if (!outer)
MVM_exception_throw_adhoc(tc, "Specified code ref has no outer");
((MVMContext *)ctx)->body.context = MVM_frame_inc_ref(tc, outer);
GET_REG(tc, 0).o = ctx;
}
Expand Down

0 comments on commit d09f92d

Please sign in to comment.