summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-09 13:02:46 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-09 13:02:46 +0200
commita0c4bfab72af05778cf2c62b8affc9086fae95f8 (patch)
tree53ca368e3c4ef0f28c30ae0df23a723946fac5c2 /pp_sys.c
parent6662c9a722f53ebc65b51c61fe887a2e8b6b479c (diff)
downloadperl-a0c4bfab72af05778cf2c62b8affc9086fae95f8.tar.gz
In pp_chdir, move SvGETMAGIC(sv) out of the if() condition.
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.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 8666a91d13..e92d13de8e 100644
--- 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);
+ }
}
}