From fd2dbd2b83d1a66966856f304534143330e0ef17 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 6 Apr 2011 06:24:00 -0700 Subject: [PATCH] [perl #87708] use integer; $tied > $tied MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 2 +- t/lib/warnings/9uninit | 2 +- t/op/tie_fetch_count.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pp.c b/pp.c index d572efc..df02e9c 100644 --- 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; } diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index de9ec47..5629917 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -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. diff --git a/t/op/tie_fetch_count.t b/t/op/tie_fetch_count.t index e0a1208..cecfd7f 100644 --- a/t/op/tie_fetch_count.t +++ b/t/op/tie_fetch_count.t @@ -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, ""; -- 2.7.4