commit 7dc3033c862c30d8998ed3e4c98c056286f31401
parent 1952b154af8f2afedbdb4b58bd1c6d9099b39973
Author: Toby Goodwin <toby@paccrat.org>
Date: Fri, 25 Aug 2017 20:46:09 +0100
Merge pull request #21 from muennich/break-varstack
Fix breaking out of loops through local variable blocks
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/except.c b/except.c
@@ -66,7 +66,7 @@ extern void rc_raise(ecodes e) {
exit(1); /* child processes exit on an error/signal */
for (; estack != NULL; estack = estack->prev)
if (estack->e != e) {
- if (e == eBreak && estack->e != eArena)
+ if (e == eBreak && estack->e != eArena && estack->e != eVarstack)
rc_error("break outside of loop");
else if (e == eReturn && estack->e == eError) /* can return from loops inside functions */
rc_error("return outside of function");