Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert incorrect MVM_is_null additions.
It should only be used on MVMObject.
  • Loading branch information
jnthn committed Apr 30, 2014
1 parent 7a8d595 commit f0524f5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/vm/moar/ops/perl6_ops.c
Expand Up @@ -486,7 +486,7 @@ 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 (MVM_is_null(tc, outer))
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 All @@ -505,18 +505,16 @@ static void p6captureouters(MVMThreadContext *tc) {
if (REPR(tgt)->ID != MVM_REPR_ID_MVMCode)
MVM_exception_throw_adhoc(tc, "p6captureouters second arg must be MVMCode");
new_outer = ((MVMCode *)tgt)->body.outer;
if (MVM_is_null(tc, new_outer))
if (!new_outer)
return;
for (i = 0; i < elems; i++) {
MVMObject *p6_code_obj = MVM_repr_at_pos_o(tc, todo, i);
MVMObject *vm_code_obj = MVM_frame_find_invokee(tc, p6_code_obj, NULL);
if (REPR(vm_code_obj)->ID == MVM_REPR_ID_MVMCode) {
MVMFrame *outer = ((MVMCode *)vm_code_obj)->body.outer;
if (outer) {
if (outer->outer)
MVM_frame_dec_ref(tc, outer->outer);
outer->outer = MVM_frame_inc_ref(tc, new_outer);
}
if (outer->outer)
MVM_frame_dec_ref(tc, outer->outer);
outer->outer = MVM_frame_inc_ref(tc, new_outer);
}
else {
MVM_exception_throw_adhoc(tc, "p6captureouters got non-code object");
Expand Down

0 comments on commit f0524f5

Please sign in to comment.