mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-14 08:27:34 +02:00
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:
parent
47ad791d5d
commit
32a68effe0
1 changed files with 3 additions and 2 deletions
5
vm.c
5
vm.c
|
@ -1838,8 +1838,9 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
sexp_gc_release3(ctx);
|
sexp_gc_release3(ctx);
|
||||||
sexp_context_top(ctx) = top;
|
tmp1 = _ARG1;
|
||||||
return _ARG1;
|
sexp_context_top(ctx) = --top;
|
||||||
|
return tmp1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sexp sexp_apply1 (sexp ctx, sexp f, sexp x) {
|
sexp sexp_apply1 (sexp ctx, sexp f, sexp x) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue