diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -131,8 +131,19 @@ retry: if(!stmt->errorguard){ if(stmt->toks[0]->array->intdata[0] == 1) return eval(stmt->guard, toplevel); - }else - print("Not registering error guard for error codes: %S\n", ppdatum(stmt->toks[0])); + }else{ + ErrorGuard *eg = newerrorguard(stmt->toks[0]->array, stmt->guard); + if(setjmp(eg->jmp)){ + eg->active = 0; + + /* Replace the old dfnframe with the one in eg->frame */ + ThreadData *td = getthreaddata(); + DfnFrame *old = td->currentdfn; + td->currentdfn = eg->frame; + freedfnframe(old, 1); + return eval(eg->guard, toplevel); + } + } } } if(stmt->next && !stop) |