From f2bd3a8b9855e84ab43505429524667042927760 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 6 Apr 2011 06:20:25 -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 com- mit, 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 c887b6b..e05b6d9 100644 --- a/pp.c +++ b/pp.c @@ -3016,7 +3016,7 @@ PP(pp_i_ge) dVAR; dSP; tryAMAGICbin_MG(ge_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 02f8f2a..f266bd4 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -573,8 +573,8 @@ 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 le (<=) at - line 15. Use of uninitialized value $m1 in integer le (<=) at - line 15. -Use of uninitialized value $g1 in integer ge (>=) at - line 16. Use of uninitialized value $m1 in integer ge (>=) at - line 16. +Use of uninitialized value $g1 in integer ge (>=) at - line 16. Use of uninitialized value $m1 in integer eq (==) at - line 17. Use of uninitialized value $g1 in integer eq (==) at - line 17. Use of uninitialized value $m1 in integer ne (!=) at - line 18. diff --git a/t/op/tie_fetch_count.t b/t/op/tie_fetch_count.t index 9b5cae3..c35b970 100644 --- a/t/op/tie_fetch_count.t +++ b/t/op/tie_fetch_count.t @@ -248,8 +248,8 @@ bin_test '.' , 1, 2, 12; bin_int_test '<' , 1, 2, 1; bin_int_test '>' , 44, 2, 1; bin_int_test '<=', 44, 2, ""; - bin_int_test '>=', 1, 2, ""; } +bin_int_test '>=', 1, 2, ""; bin_int_test '==', 1, 2, ""; bin_int_test '!=', 1, 2, 1; bin_int_test '<=>', 1, 2, -1; -- 2.7.4