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
commitd2a96e185e1b71ff357f345320f6b779ef405c61 (patch)
treed17fe60b1f9973745e8a7a4dc5180e630f87d561 /scope.c
parent1c9a023abcf67153a0d9591b148b7172d33af0de (diff)
downloadperl-d2a96e185e1b71ff357f345320f6b779ef405c61.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)
{