summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorMichael Breen <perl@mbreen.com>2009-12-11 17:48:51 +0000
committerRafael Garcia-Suarez <rgs@consttype.org>2009-12-14 15:08:25 +0100
commit2ab54efd6265713df5cd4bd0927024245675c1c2 (patch)
tree211610a2ee4e47471d0a2a8df034aa1ea135042d /gv.c
parent412147f664b7f5805591ad996d7e5a9e70b3d80f (diff)
downloadperl-2ab54efd6265713df5cd4bd0927024245675c1c2.tar.gz
fix bug 67156: overload: nomethod(..., '!') return value inverted
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/gv.c b/gv.c
index 932b2b8002..9743354c72 100644
--- a/gv.c
+++ b/gv.c
@@ -1902,7 +1902,8 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
(void)((cv = cvp[off=bool__amg])
|| (cv = cvp[off=numer_amg])
|| (cv = cvp[off=string_amg]));
- postpr = 1;
+ if (cv)
+ postpr = 1;
break;
case copy_amg:
{
@@ -2007,35 +2008,24 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
case ge_amg:
case eq_amg:
case ne_amg:
- postpr = 1; off=ncmp_amg; break;
+ off = ncmp_amg;
+ break;
case slt_amg:
case sle_amg:
case sgt_amg:
case sge_amg:
case seq_amg:
case sne_amg:
- postpr = 1; off=scmp_amg; break;
+ off = scmp_amg;
+ break;
}
- if (off != -1) cv = cvp[off];
- if (!cv) {
- goto not_found;
- }
+ if ((off != -1) && (cv = cvp[off]))
+ postpr = 1;
+ else
+ goto not_found;
} else {
not_found: /* No method found, either report or croak */
switch (method) {
- case lt_amg:
- case le_amg:
- case gt_amg:
- case ge_amg:
- case eq_amg:
- case ne_amg:
- case slt_amg:
- case sle_amg:
- case sgt_amg:
- case sge_amg:
- case seq_amg:
- case sne_amg:
- postpr = 0; break;
case to_sv_amg:
case to_av_amg:
case to_hv_amg: