Re: [perl #33892] Add Interix support
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index d5b8b7f..b2dc422 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,7 +1,7 @@
 /*    scope.c
  *
  *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- *    2000, 2001, 2002, 2003, 2004, by Larry Wall and others
+ *    2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -13,7 +13,7 @@
  * levels..."
  */
 
-/* This function contains functions to manipluate various of perl's stacks;
+/* This file contains functions to manipulate several of Perl's stacks;
  * in particular it contains code to push various types of things onto
  * the savestack, then to pop them off and perform the correct restorative
  * action for each one. This corresponds to the cleanup Perl does at
 #define PERL_IN_SCOPE_C
 #include "perl.h"
 
-#if defined(PERL_FLEXIBLE_EXCEPTIONS)
-void *
-Perl_default_protect(pTHX_ volatile JMPENV *pcur_env, int *excpt,
-                    protect_body_t body, ...)
-{
-    void *ret;
-    va_list args;
-    va_start(args, body);
-    ret = vdefault_protect(pcur_env, excpt, body, &args);
-    va_end(args);
-    return ret;
-}
-
-void *
-Perl_vdefault_protect(pTHX_ volatile JMPENV *pcur_env, int *excpt,
-                     protect_body_t body, va_list *args)
-{
-    int ex;
-    void *ret;
-
-    JMPENV_PUSH(ex);
-    if (ex)
-       ret = NULL;
-    else
-       ret = CALL_FPTR(body)(aTHX_ *args);
-    *excpt = ex;
-    JMPENV_POP;
-    return ret;
-}
-#endif
-
 SV**
 Perl_stack_grow(pTHX_ SV **sp, SV **p, int n)
 {
@@ -381,9 +350,8 @@ Perl_save_hash(pTHX_ GV *gv)
 void
 Perl_save_item(pTHX_ register SV *item)
 {
-    register SV *sv = NEWSV(0,0);
+    register SV *sv = newSVsv(item);
 
-    sv_setsv(sv,item);
     SSCHECK(3);
     SSPUSHPTR(item);           /* remember the pointer */
     SSPUSHPTR(sv);             /* remember the value */
@@ -933,14 +901,8 @@ Perl_leave_scope(pTHX_ I32 base)
                    break;
                case SVt_PVCV:
                    Perl_croak(aTHX_ "panic: leave_scope pad code");
-               case SVt_RV:
-               case SVt_IV:
-               case SVt_NV:
-                   (void)SvOK_off(sv);
-                   break;
                default:
-                   (void)SvOK_off(sv);
-                   (void)SvOOK_off(sv);
+                   SvOK_off(sv);
                    break;
                }
                SvPADSTALE_on(sv); /* mark as no longer live */
@@ -1184,3 +1146,13 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
     }
 #endif /* DEBUGGING */
 }
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vim: shiftwidth=4:
+*/