From: David Mitchell Date: Fri, 21 May 2010 16:07:40 +0000 (+0100) Subject: followup to magic/overload fix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed3b9b3c212f717939207379cdb328156dd4a01e;p=p5sagit%2Fp5-mst-13.2.git followup to magic/overload fix 6f1401dc2acd2a2b85df22b0a74e5f7e6e0a33aa was over-enthusiastic on removing redundant code in the comparison ops. This code was only used on 64-bit #ifdef branches which is why I failed to spot it earlier. So restore that code! --- diff --git a/pp.c b/pp.c index b346026..fa20914 100644 --- a/pp.c +++ b/pp.c @@ -1852,7 +1852,7 @@ PP(pp_lt) #ifdef PERL_PRESERVE_IVUV else #endif - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) < SvRV(TOPp1s))); RETURN; @@ -1936,7 +1936,7 @@ PP(pp_gt) #ifdef PERL_PRESERVE_IVUV else #endif - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) > SvRV(TOPp1s))); RETURN; @@ -2020,7 +2020,7 @@ PP(pp_le) #ifdef PERL_PRESERVE_IVUV else #endif - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) <= SvRV(TOPp1s))); RETURN; @@ -2104,7 +2104,7 @@ PP(pp_ge) #ifdef PERL_PRESERVE_IVUV else #endif - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) >= SvRV(TOPp1s))); RETURN; @@ -2129,7 +2129,7 @@ PP(pp_ne) dVAR; dSP; tryAMAGICbin_MG(ne_amg,AMGf_set); #ifndef NV_PRESERVES_UV - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) != SvRV(TOPp1s))); RETURN; @@ -2206,7 +2206,7 @@ PP(pp_ncmp) dVAR; dSP; dTARGET; tryAMAGICbin_MG(ncmp_amg, 0); #ifndef NV_PRESERVES_UV - if (SvROK(TOPs) && SvROK(TOPm1s) ) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { const UV right = PTR2UV(SvRV(POPs)); const UV left = PTR2UV(SvRV(TOPs)); SETi((left > right) - (left < right)); diff --git a/pp_hot.c b/pp_hot.c index 52d0d8d..edc4854 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -332,7 +332,7 @@ PP(pp_eq) dVAR; dSP; tryAMAGICbin_MG(eq_amg, AMGf_set); #ifndef NV_PRESERVES_UV - if (SvROK(TOPs) && SvROK(TOPm1s)) { + if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { SP--; SETs(boolSV(SvRV(TOPs) == SvRV(TOPp1s))); RETURN;