diff options
author | Chip Salzenberg <chip@perl.com> | 1997-03-31 18:38:42 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-01 12:01:35 +1200 |
commit | 22921e25517d6c195d0fab9eb946bfafb563c256 (patch) | |
tree | e7ef4ba682dc5663a43c21c9ade1232c27eff250 /scope.h | |
parent | ac1d45ba28d946eab50fa4af2a48e56aa1122da1 (diff) | |
download | perl-22921e25517d6c195d0fab9eb946bfafb563c256.tar.gz |
Don't use setjmp() and longjmp() in complex exprs
Diffstat (limited to 'scope.h')
-rw-r--r-- | scope.h | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -96,16 +96,25 @@ struct jmpenv { typedef struct jmpenv JMPENV; #define dJMPENV JMPENV cur_env -#define JMPENV_PUSH (cur_env.je_prev = top_env, \ - cur_env.je_ret = Sigsetjmp(cur_env.je_buf,1), \ - top_env = &cur_env, \ - cur_env.je_mustcatch = FALSE, \ - cur_env.je_ret) -#define JMPENV_POP (top_env = cur_env.je_prev) -#define JMPENV_JUMP(v) (top_env->je_prev ? Siglongjmp(top_env->je_buf, (v)) \ - : ((v) == 2) ? exit(STATUS_NATIVE_EXPORT) \ - : (PerlIO_printf(PerlIO_stderr(), "panic: top_env\n"), \ - exit(1))) +#define JMPENV_PUSH(v) \ + STMT_START { \ + cur_env.je_prev = top_env; \ + cur_env.je_ret = Sigsetjmp(cur_env.je_buf, 1); \ + top_env = &cur_env; \ + cur_env.je_mustcatch = FALSE; \ + (v) = cur_env.je_ret; \ + } STMT_END +#define JMPENV_POP \ + STMT_START { top_env = cur_env.je_prev; } STMT_END +#define JMPENV_JUMP(v) \ + STMT_START { \ + if (top_env->je_prev) \ + Siglongjmp(top_env->je_buf, (v)); \ + if ((v) == 2) \ + exit(STATUS_NATIVE_EXPORT); \ + PerlIO_printf(PerlIO_stderr(), "panic: top_env\n"); \ + exit(1); \ + } STMT_END #define CATCH_GET (top_env->je_mustcatch) #define CATCH_SET(v) (top_env->je_mustcatch = (v)) |