summaryrefslogtreecommitdiff
path: root/pez.c
diff options
context:
space:
mode:
Diffstat (limited to 'pez.c')
-rw-r--r--pez.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pez.c b/pez.c
index a6a7c92..1ad9670 100644
--- a/pez.c
+++ b/pez.c
@@ -1354,7 +1354,7 @@ exefn(PezContext *cx, Fn *fn, uint nargs)
CASE(Onop) {}
CASE(Oret) {
Val ret = pop(cx);
- cx->stktop -= pr->nvars;
+ cx->stktop = locals;
assert(cx->stktop >= cx->stack);
push(cx, ret);
closeups(cx, args);
@@ -3513,6 +3513,8 @@ stmt(Comp *cm)
TRY(readident(cm, buf, sizeof buf));
if (!strcmp(buf, "FOR")) {
return forstmt(cm);
+ } else if (!strcmp(buf, "RET")) {
+ return expr(cm) && compop(cm, Oret);
} else {
strcpy(cm->stash_ident, buf);
return expr(cm);