diff options
Diffstat (limited to 'pez.c')
| -rw-r--r-- | pez.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |