summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorBrent Dax <brentdax@cpan.org>2002-07-25 22:41:52 -0700
committerhv <hv@crypt.org>2002-08-05 15:04:54 +0000
commitc963b151157dab5813a32fc6004b63916ad155e8 (patch)
treee88a528a16616c2f136f31b2c37b08e237b08799 /pp_hot.c
parentd73f34fb2db5664941bbe71b34c335b0ae3b50b3 (diff)
downloadperl-c963b151157dab5813a32fc6004b63916ad155e8.tar.gz
Defined-or patch (cleaned up)
From: "Brent Dax" <brentdax@cpan.org> Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue> p4raw-id: //depot/perl@17682
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index ae1b1c209e..8f042b9343 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -320,6 +320,42 @@ PP(pp_or)
}
}
+PP(pp_dor)
+{
+ /* Most of this is lifted straight from pp_defined */
+ dSP;
+ register SV* sv;
+
+ sv = TOPs;
+ if (!sv || !SvANY(sv)) {
+ --SP;
+ RETURNOP(cLOGOP->op_other);
+ }
+
+ switch (SvTYPE(sv)) {
+ case SVt_PVAV:
+ if (AvMAX(sv) >= 0 || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied)))
+ RETURN;
+ break;
+ case SVt_PVHV:
+ if (HvARRAY(sv) || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied)))
+ RETURN;
+ break;
+ case SVt_PVCV:
+ if (CvROOT(sv) || CvXSUB(sv))
+ RETURN;
+ break;
+ default:
+ if (SvGMAGICAL(sv))
+ mg_get(sv);
+ if (SvOK(sv))
+ RETURN;
+ }
+
+ --SP;
+ RETURNOP(cLOGOP->op_other);
+}
+
PP(pp_add)
{
dSP; dATARGET; bool useleft; tryAMAGICbin(add,opASSIGN);