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 cb041b7..1209f7c 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1486,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) {
@@ -1773,7 +1785,7 @@ PP(pp_goto)
                }
                else {
                    stack_sp--;         /* There is no cv arg. */
-                   (void)(*CvXSUB(cv))(cv _THIS);
+                   (void)(*CvXSUB(cv))(cv _PERL_OBJECT_THIS);
                }
                LEAVE;
                return pop_return();
@@ -2466,7 +2478,7 @@ PP(pp_require)
     SvREFCNT_dec(namesv);
     if (!tryrsfp) {
        if (op->op_type == OP_REQUIRE) {
-           SV *msg = sv_2mortal(newSVpvf("Can't locate '%s' in @INC", name));
+           SV *msg = sv_2mortal(newSVpvf("Can't locate %s in @INC", name));
            SV *dirmsgsv = NEWSV(0, 0);
            AV *ar = GvAVn(incgv);
            I32 i;