summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2017-08-25 20:46:09 +0100
committerGitHub <noreply@github.com>2017-08-25 20:46:09 +0100
commit7dc3033c862c30d8998ed3e4c98c056286f31401 (patch)
tree31cd67d547bdf7c9a63fae03a34b0dd6d8bdd538
parent1952b154af8f2afedbdb4b58bd1c6d9099b39973 (diff)
parenteb594861d41090b53272a6bc8941bf2075c4311f (diff)
Merge pull request #21 from muennich/break-varstack
Fix breaking out of loops through local variable blocks
-rw-r--r--except.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/except.c b/except.c
index 8f20676..37696c4 100644
--- 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");