Check if m->env is NULL before dereferencing it; fix #3436

parent b277c58e
...@@ -1309,7 +1309,9 @@ RETRY_TRY_BLOCK: ...@@ -1309,7 +1309,9 @@ RETRY_TRY_BLOCK:
else { else {
stack_extend(mrb, irep->nregs, ci->argc+2); stack_extend(mrb, irep->nregs, ci->argc+2);
} }
regs[0] = m->env->stack[0]; if(m->env) {
regs[0] = m->env->stack[0];
}
pc = irep->iseq; pc = irep->iseq;
JUMP; JUMP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment