lset/lerf can access to torn-off regions because of call/cc
This commit is contained in:
parent
129c4c1bd9
commit
a3a8b11d4b
12
vm.c
12
vm.c
|
@ -668,10 +668,22 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
CASE(OP_LREF) {
|
CASE(OP_LREF) {
|
||||||
|
pic_callinfo *ci = pic->ci;
|
||||||
|
|
||||||
|
if (ci->env != NULL && ci->env->regs == ci->env->storage) {
|
||||||
|
PUSH(ci->env->regs[c.u.i - (ci->regs - ci->fp)]);
|
||||||
|
NEXT;
|
||||||
|
}
|
||||||
PUSH(pic->ci->fp[c.u.i]);
|
PUSH(pic->ci->fp[c.u.i]);
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
CASE(OP_LSET) {
|
CASE(OP_LSET) {
|
||||||
|
pic_callinfo *ci = pic->ci;
|
||||||
|
|
||||||
|
if (ci->env != NULL && ci->env->regs == ci->env->storage) {
|
||||||
|
ci->env->regs[c.u.i - (ci->regs - ci->fp)] = POP();
|
||||||
|
NEXT;
|
||||||
|
}
|
||||||
pic->ci->fp[c.u.i] = POP();
|
pic->ci->fp[c.u.i] = POP();
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue