summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>1999-03-09 06:51:57 -0500
committerGurusamy Sarathy <gsar@cpan.org>1999-05-11 02:49:07 +0000
commit312caa8e97f1c7ee342a9895c2f0e749625b4929 (patch)
treed17fe60b1f9973745e8a7a4dc5180e630f87d561 /scope.c
parent810b8aa5436a934d1a2016588cbacf9b55463c40 (diff)
downloadperl-312caa8e97f1c7ee342a9895c2f0e749625b4929.tar.gz
gutsupport for C++ exceptions
Message-ID: <19990309115157.E7911@perlsupport.com> Subject: [PATCH 5.005] Flexible Exceptions p4raw-id: //depot/perl@3386
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index b8d45584e2..6c9c427670 100644
--- a/scope.c
+++ b/scope.c
@@ -15,6 +15,30 @@
#include "EXTERN.h"
#include "perl.h"
+void *
+default_protect(int *except, protect_body_t body, ...)
+{
+ dTHR;
+ dJMPENV;
+ va_list args;
+ int ex;
+ void *ret;
+
+ DEBUG_l(deb("Setting up local jumplevel %p, was %p\n",
+ &cur_env, PL_top_env));
+ JMPENV_PUSH(ex);
+ if (ex)
+ ret = NULL;
+ else {
+ va_start(args, body);
+ ret = body(args);
+ va_end(args);
+ }
+ *except = ex;
+ JMPENV_POP;
+ return ret;
+}
+
SV**
stack_grow(SV **sp, SV **p, int n)
{