Call FETCH once for stacked filetest ops
authorFather Chrysostomos <sprout@cpan.org>
Tue, 24 Jan 2012 17:23:02 +0000 (09:23 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 24 Jan 2012 17:23:02 +0000 (09:23 -0800)
pp_sys.c
t/op/tie_fetch_count.t

index 47c8a35..d4f1b9f 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2949,7 +2949,7 @@ S_try_amagic_ftest(pTHX_ char chr) {
     SV* const arg = TOPs;
 
     assert(chr != '?');
-    SvGETMAGIC(arg);
+    if (!(PL_op->op_private & OPpFT_STACKING)) SvGETMAGIC(arg);
 
     if (SvAMAGIC(TOPs))
     {
index d9d4989..d721f42 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
     require './test.pl';
-    plan (tests => 298);
+    plan (tests => 299);
 }
 
 use strict;
@@ -142,6 +142,8 @@ for (split //, 'rwxoRWXOezsfdpSbctugkTBMAC') {
     check_count "-$_ \\\$tied_glob";
 }
 $dummy  = -l $var       ; check_count '-l';
+$var = "test.pl";
+$dummy  = -e -e -e $var ; check_count '-e -e';
 
 # Matching
 $_ = "foo";