summaryrefslogtreecommitdiff
path: root/pp.h
diff options
context:
space:
mode:
Diffstat (limited to 'pp.h')
-rw-r--r--pp.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/pp.h b/pp.h
index 27f948cfdc..3f2aea9dca 100644
--- a/pp.h
+++ b/pp.h
@@ -451,21 +451,8 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
#define tryAMAGICunDEREF_var(meth_enum) \
STMT_START { \
- SV *tmpsv; \
- SV *arg = *sp; \
- while (SvAMAGIC(arg) && \
- (tmpsv = amagic_call(arg, &PL_sv_undef, meth_enum, \
- AMGf_noright | AMGf_unary))) { \
- SPAGAIN; \
- sv = tmpsv; \
- if (!SvROK(tmpsv)) \
- Perl_croak(aTHX_ "Overloaded dereference did not return a reference"); \
- if (tmpsv == arg || SvRV(tmpsv) == SvRV(arg)) { \
- /* Bail out if it returns us the same reference. */ \
- break; \
- } \
- arg = tmpsv; \
- } \
+ sv = amagic_deref_call(aTHX_ *sp, meth_enum); \
+ SPAGAIN; \
} STMT_END
#define tryAMAGICunDEREF(meth) tryAMAGICunDEREF_var(CAT2(meth,_amg))