Inline macro tryAMAGICbinSET() in smart match routine
Rafael Garcia-Suarez [Tue, 24 Mar 2009 17:30:20 +0000 (18:30 +0100)]
(to build tricks on a sane base)

pp_ctl.c

index a8a3610..1c68602 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4033,7 +4033,15 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other)
 #   define SM_SEEN_OTHER(sv) hv_exists_ent(seen_other, \
        sv_2mortal(newSViv(PTR2IV(sv))), 0)
 
-    tryAMAGICbinSET(smart, 0);
+    if (SvAMAGIC(d) || SvAMAGIC(e)) {
+       SV * const tmpsv = amagic_call(d, e, smart_amg, 0);
+       if (tmpsv) {
+           SPAGAIN;
+           (void)POPs;
+           SETs(tmpsv);
+           RETURN;
+       }
+    }
 
     SP -= 2;   /* Pop the values */