Fixing bug off-by-one bug in sexp_apply - stack top was left one higher than on entry to hold the result.

This was never noticed before because other functions like eval cleanup the
top, and otherwise sexp_apply was never called directly from C code in a loop.
This commit is contained in:
Alex Shinn 2011-12-01 08:43:39 +09:00
parent 47ad791d5d
commit 32a68effe0

5
vm.c
View file

@ -1838,8 +1838,9 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
}
#endif
sexp_gc_release3(ctx);
sexp_context_top(ctx) = top;
return _ARG1;
tmp1 = _ARG1;
sexp_context_top(ctx) = --top;
return tmp1;
}
sexp sexp_apply1 (sexp ctx, sexp f, sexp x) {