[bugfix] variables defined by internal definitions may be referred from
inner environments
This commit is contained in:
parent
249061982f
commit
b56b86aae2
|
@ -273,8 +273,9 @@ codegen(codegen_state *state, pic_value obj, bool tailpos)
|
||||||
else {
|
else {
|
||||||
idx = scope_local_define(pic, pic_symbol_name(pic, pic_sym(var)), s);
|
idx = scope_local_define(pic, pic_symbol_name(pic, pic_sym(var)), s);
|
||||||
codegen(state, val, false);
|
codegen(state, val, false);
|
||||||
irep->code[irep->clen].insn = OP_LSET;
|
irep->code[irep->clen].insn = OP_CSET;
|
||||||
irep->code[irep->clen].u.i = idx;
|
irep->code[irep->clen].u.r.depth = 0;
|
||||||
|
irep->code[irep->clen].u.r.idx = idx;
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
irep->code[irep->clen].insn = OP_PUSHFALSE;
|
irep->code[irep->clen].insn = OP_PUSHFALSE;
|
||||||
irep->clen++;
|
irep->clen++;
|
||||||
|
|
3
src/vm.c
3
src/vm.c
|
@ -432,6 +432,9 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
|
||||||
L_CALL:
|
L_CALL:
|
||||||
x = pic->sp[-c.u.i];
|
x = pic->sp[-c.u.i];
|
||||||
if (! pic_proc_p(x)) {
|
if (! pic_proc_p(x)) {
|
||||||
|
#if DEBUG
|
||||||
|
pic_debug(pic, x);
|
||||||
|
#endif
|
||||||
pic->errmsg = "invalid application";
|
pic->errmsg = "invalid application";
|
||||||
goto L_RAISE;
|
goto L_RAISE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue