[perl #87708] use integer; $tied > $tied
authorFather Chrysostomos <sprout@cpan.org>
Wed, 6 Apr 2011 13:24:00 +0000 (06:24 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 6 Apr 2011 15:40:08 +0000 (08:40 -0700)
This is just part of #87708.

This fixes > under â€˜use integer’ when the same tied scalar is used for
both operands and returns two different values. Before this commit,
get-magic would be called only once and the same value used. In 5.12.x
the operands were swapped.

pp.c
t/lib/warnings/9uninit
t/op/tie_fetch_count.t

diff --git a/pp.c b/pp.c
index d572efc..df02e9c 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -2994,7 +2994,7 @@ PP(pp_i_gt)
     dVAR; dSP;
     tryAMAGICbin_MG(gt_amg, AMGf_set);
     {
-      dPOPTOPiirl_nomg;
+      dPOPTOPiirl_halfmg;
       SETs(boolSV(left > right));
       RETURN;
     }
index de9ec47..5629917 100644 (file)
@@ -569,8 +569,8 @@ Use of uninitialized value $m1 in integer modulus (%) at - line 11.
 Use of uninitialized value $m2 in integer modulus (%) at - line 12.
 Use of uninitialized value $g1 in integer lt (<) at - line 13.
 Use of uninitialized value $m1 in integer lt (<) at - line 13.
-Use of uninitialized value $g1 in integer gt (>) at - line 14.
 Use of uninitialized value $m1 in integer gt (>) at - line 14.
+Use of uninitialized value $g1 in integer gt (>) at - line 14.
 Use of uninitialized value $m1 in integer le (<=) at - line 15.
 Use of uninitialized value $g1 in integer le (<=) at - line 15.
 Use of uninitialized value $m1 in integer ge (>=) at - line 16.
index e0a1208..cecfd7f 100644 (file)
@@ -246,8 +246,8 @@ bin_test '.' ,  1, 2, 12;
         { local $TODO; check_count '- under use integer',  2; }
     }
     bin_int_test '<' ,  1, 2, 1;
-    bin_int_test '>' , 44, 2, 1;
 }
+bin_int_test '>' , 44, 2, 1;
 bin_int_test '<=', 44, 2, "";
 bin_int_test '>=',  1, 2, "";
 bin_int_test '==',  1, 2, "";