summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2020-06-02 22:48:06 +0100
committerKarl Williamson <khw@cpan.org>2020-07-30 15:30:46 -0600
commitfe9826e33c11ebd16105e6edec6ba6f7196e6629 (patch)
tree83d1b83b75af1205a18ff56a4d0403562d33f807 /pp_hot.c
parente02f7c069a8e7dd98b0ec010e9b3c6619b46baf3 (diff)
downloadperl-fe9826e33c11ebd16105e6edec6ba6f7196e6629.tar.gz
pp.c/pp_hot.c - add NV<->NV case to numerical comparison ops
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 341c8eebb5..e9f1ffe7a4 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1262,14 +1262,20 @@ PP(pp_eq)
{
dSP;
SV *left, *right;
+ U32 flags_and, flags_or;
tryAMAGICbin_MG(eq_amg, AMGf_numeric);
right = POPs;
left = TOPs;
+ flags_and = SvFLAGS(left) & SvFLAGS(right);
+ flags_or = SvFLAGS(left) | SvFLAGS(right);
+
SETs(boolSV(
- (SvIOK_notUV(left) && SvIOK_notUV(right))
- ? (SvIVX(left) == SvIVX(right))
- : ( do_ncmp(left, right) == 0)
+ ( (flags_and & SVf_IOK) && ((flags_or & SVf_IVisUV) ==0 ) )
+ ? (SvIVX(left) == SvIVX(right))
+ : (flags_and & SVf_NOK)
+ ? (SvNVX(left) == SvNVX(right))
+ : ( do_ncmp(left, right) == 0)
));
RETURN;
}