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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-02-08 19:01:09 +09:00
parent b277c58e78
commit 76135e757f
+3 -1
View File
@@ -1309,7 +1309,9 @@ RETRY_TRY_BLOCK:
else {
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;
JUMP;
}