simplify tryAMAGICunTARGET
authorDavid Mitchell <davem@iabyn.com>
Mon, 3 Jan 2011 12:54:21 +0000 (12:54 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 3 Jan 2011 12:54:21 +0000 (12:54 +0000)
Expecting the targ in sp[-1] rather than sp[0] is accomplished
cleanly using dATARGET.

pp.h

diff --git a/pp.h b/pp.h
index 4d03953..d60666a 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -433,10 +433,7 @@ Does not use C<TARG>.  See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
 
 #define tryAMAGICunTARGET(meth, shift, jump)                           \
     STMT_START {                                               \
-       dSP;                                                    \
-       sp--; /* get TARGET from below PL_stack_sp */           \
-       {                                                       \
-           dTARGETSTACKED;                                     \
+           dATARGET;                                           \
            dSP;                                                \
            SV *tmpsv;                                          \
            SV *arg= sp[shift];                                 \
@@ -456,7 +453,6 @@ Does not use C<TARG>.  See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
                }                                               \
                return NORMAL;                                  \
            }                                                   \
-       }                                                       \
     } STMT_END
 
 /* This is no longer used anywhere in the core. You might wish to consider