summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-03-31 18:38:42 +1200
committerChip Salzenberg <chip@atlantic.net>1997-04-01 12:01:35 +1200
commit22921e25517d6c195d0fab9eb946bfafb563c256 (patch)
treee7ef4ba682dc5663a43c21c9ade1232c27eff250 /scope.h
parentac1d45ba28d946eab50fa4af2a48e56aa1122da1 (diff)
downloadperl-22921e25517d6c195d0fab9eb946bfafb563c256.tar.gz
Don't use setjmp() and longjmp() in complex exprs
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/scope.h b/scope.h
index d6eb270a90..debe1f88a7 100644
--- a/scope.h
+++ b/scope.h
@@ -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))