This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In pp_chdir, move SvGETMAGIC(sv) out of the if() condition.
authorNicholas Clark <nick@ccl4.org>
Fri, 9 Sep 2011 11:02:46 +0000 (13:02 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 9 Sep 2011 11:02:46 +0000 (13:02 +0200)
It was added to the if() condition as part of 935647290357b277.
Unfortunately the syntax used to implemented SvGETMAGIC(sv) is considered by
gcc to be valid in an expression, but is not valid in other compilers.

pp_sys.c

index 8666a91..e92d13d 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3466,14 +3466,17 @@ PP(pp_chdir)
        if (PL_op->op_flags & OPf_SPECIAL) {
            gv = gv_fetchsv(sv, 0, SVt_PVIO);
        }
-        else if (SvGETMAGIC(sv), isGV_with_GP(sv)) {
-           gv = MUTABLE_GV(sv);
-        }
-       else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
-            gv = MUTABLE_GV(SvRV(sv));
-        }
         else {
-           tmps = SvPV_nomg_const_nolen(sv);
+           SvGETMAGIC(sv);
+           if(isGV_with_GP(sv)) {
+               gv = MUTABLE_GV(sv);
+           }
+           else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
+               gv = MUTABLE_GV(SvRV(sv));
+           }
+           else {
+               tmps = SvPV_nomg_const_nolen(sv);
+           }
        }
     }