Skip to content

Commit

Permalink
Ensure Scalar fetch can never return a NULL.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jul 17, 2017
1 parent a0775e5 commit 2f5a6cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vm/moar/ops/container.c
Expand Up @@ -12,7 +12,8 @@ static MVMCallsiteEntry tc_flags[] = { MVM_CALLSITE_ARG_OBJ,
static MVMCallsite tc_callsite = { tc_flags, 3, 3, 3, 0 };

static void rakudo_scalar_fetch(MVMThreadContext *tc, MVMObject *cont, MVMRegister *res) {
res->o = ((Rakudo_Scalar *)cont)->value;
MVMObject *value = ((Rakudo_Scalar *)cont)->value;
res->o = value ? value : tc->instance->VMNull;
}

static void rakudo_scalar_fetch_i(MVMThreadContext *tc, MVMObject *cont, MVMRegister *res) {
Expand Down

0 comments on commit 2f5a6cd

Please sign in to comment.