This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.h: Move #if
[perl5.git] / pp_sys.c
index 1ee3ba2..41a315d 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -903,7 +903,7 @@ PP(pp_tie)
                vivify_defelem(varsv);
                varsv = LvTARG(varsv);
            }
-           /* FALL THROUGH */
+           /* FALLTHROUGH */
        default:
            methname = "TIESCALAR";
            how = PERL_MAGIC_tiedscalar;
@@ -1005,21 +1005,23 @@ PP(pp_tied)
     dVAR;
     dSP;
     const MAGIC *mg;
-    SV *sv = POPs;
+    dTOPss;
     const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV)
                ? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar;
 
     if (isGV_with_GP(sv) && !SvFAKE(sv) && !(sv = MUTABLE_SV(GvIOp(sv))))
-       RETPUSHUNDEF;
+       goto ret_undef;
 
     if (SvTYPE(sv) == SVt_PVLV && LvTYPE(sv) == 'y' &&
-       !(sv = defelem_target(sv, NULL))) RETPUSHUNDEF;
+       !(sv = defelem_target(sv, NULL))) goto ret_undef;
 
     if ((mg = SvTIED_mg(sv, how))) {
-       PUSHs(SvTIED_obj(sv, mg));
-       RETURN;
+       SETs(SvTIED_obj(sv, mg));
+       return NORMAL; /* PUTBACK not needed, pp_tied never moves SP */
     }
-    RETPUSHUNDEF;
+    ret_undef:
+    SETs(&PL_sv_undef);
+    return NORMAL;
 }
 
 PP(pp_dbmopen)
@@ -3063,7 +3065,7 @@ PP(pp_ftrread)
        access_mode = W_OK;
 #endif
        stat_mode = S_IWUSR;
-       /* fall through */
+       /* FALLTHROUGH */
 
     case OP_FTEREAD:
 #ifndef PERL_EFF_ACCESS
@@ -3406,6 +3408,7 @@ PP(pp_fttext)
         const char *file;
         int fd; 
 
+        assert(sv);
        sv_setpv(PL_statname, SvPV_nomg_const_nolen(sv));
       really_filename:
         file = SvPVX_const(PL_statname);