change#3449 wasn't doing enough
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index b8d4558..ad7fe29 100644 (file)
--- a/scope.c
+++ b/scope.c
 #include "EXTERN.h"
 #include "perl.h"
 
+void *
+default_protect(int *excpt, 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 = CALL_FPTR(body)(args);
+       va_end(args);
+    }
+    *excpt = ex;
+    JMPENV_POP;
+    return ret;
+}
+
 SV**
 stack_grow(SV **sp, SV **p, int n)
 {