This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
updated hints file to cope with buggy sigsetjmp() on Solaris-x86
[perl5.git] / pp_ctl.c
index ac2ddfc..1209f7c 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -76,8 +76,8 @@ PP(pp_regcomp) {
     MAGIC *mg = Null(MAGIC*);
 
     tmpstr = POPs;
-    if(SvROK(tmpstr) || SvRMAGICAL(tmpstr)) {
-       SV *sv = SvROK(tmpstr) ? SvRV(tmpstr) : tmpstr;
+    if(SvROK(tmpstr)) {
+       SV *sv = SvRV(tmpstr);
        if(SvMAGICAL(sv))
            mg = mg_find(sv, 'r');
     }
@@ -101,7 +101,6 @@ PP(pp_regcomp) {
 
            pm->op_pmflags = pm->op_pmpermflags;        /* reset case sensitivity */
            pm->op_pmregexp = pregcomp(t, t + len, pm);
-           sv_magic(tmpstr,(SV*)ReREFCNT_inc(pm->op_pmregexp),'r',0,0);
        }
     }
 
@@ -1487,10 +1486,22 @@ PP(pp_return)
 
     TAINT_NOT;
     if (gimme == G_SCALAR) {
-       if (MARK < SP)
-           *++newsp = (popsub2 && SvTEMP(*SP))
-                       ? *SP : sv_mortalcopy(*SP);
-       else
+       if (MARK < SP) {
+           if (popsub2) {
+               if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+                   if (SvTEMP(TOPs)) {
+                       *++newsp = SvREFCNT_inc(*SP);
+                       FREETMPS;
+                       sv_2mortal(*newsp);
+                   } else {
+                       FREETMPS;
+                       *++newsp = sv_mortalcopy(*SP);
+                   }
+               } else
+                   *++newsp = (SvTEMP(*SP)) ? *SP : sv_mortalcopy(*SP);
+           } else
+               *++newsp = sv_mortalcopy(*SP);
+       } else
            *++newsp = &sv_undef;
     }
     else if (gimme == G_ARRAY) {
@@ -2015,7 +2026,7 @@ PP(pp_goto)
 
     if (top_env->je_prev) {
         restartop = retop;
-        JMPENV_JUMP(JMP_EXCEPTION);
+        JMPENV_JUMP(3);
     }
 
     RETURNOP(retop);
@@ -2110,7 +2121,7 @@ STATIC OP *
 docatch(OP *o)
 {
     dTHR;
-    int jmpstat;
+    int ret;
     OP *oldop = op;
     dJMPENV;
 
@@ -2119,14 +2130,14 @@ docatch(OP *o)
     assert(CATCH_GET == TRUE);
     DEBUG_l(deb("Setting up local jumplevel %p, was %p\n", &cur_env, top_env));
 #endif
-    JMPENV_PUSH(jmpstat);
-    switch (jmpstat) {
+    JMPENV_PUSH(ret);
+    switch (ret) {
     default:                           /* topmost level handles it */
        JMPENV_POP;
        op = oldop;
-       JMPENV_JUMP(jmpstat);
+       JMPENV_JUMP(ret);
        /* NOTREACHED */
-    case JMP_EXCEPTION:
+    case 3:
        if (!restartop) {
            PerlIO_printf(PerlIO_stderr(), "panic: restartop\n");
            break;
@@ -2134,7 +2145,7 @@ docatch(OP *o)
        op = restartop;
        restartop = 0;
        /* FALL THROUGH */
-    case JMP_NORMAL:
+    case 0:
         CALLRUNOPS();
        break;
     }