Skip to content

Commit

Permalink
pp_defined: modify OP_DEFINED paths to use TOPs and RETSETs
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach committed Aug 10, 2021
1 parent 7167e19 commit 9cc3d6f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pp_hot.c
Expand Up @@ -1346,14 +1346,13 @@ PP(pp_or)
PP(pp_defined)
{
dSP;
SV* sv;
bool defined;
SV* sv = TOPs;
bool defined = FALSE;
const int op_type = PL_op->op_type;
const bool is_dor = (op_type == OP_DOR || op_type == OP_DORASSIGN);

if (is_dor) {
PERL_ASYNC_CHECK();
sv = TOPs;
if (UNLIKELY(!sv || !SvANY(sv))) {
if (op_type == OP_DOR)
--SP;
Expand All @@ -1362,12 +1361,10 @@ PP(pp_defined)
}
else {
/* OP_DEFINED */
sv = POPs;
if (UNLIKELY(!sv || !SvANY(sv)))
RETPUSHNO;
RETSETNO;
}

defined = FALSE;
if (UNLIKELY(SvTYPE(sv) == SVt_PVCV)) {
if (CvROOT(sv) || CvXSUB(sv))
defined = TRUE;
Expand All @@ -1387,8 +1384,8 @@ PP(pp_defined)
}
/* assuming OP_DEFINED */
if(defined)
RETPUSHYES;
RETPUSHNO;
RETSETYES;
RETSETNO;
}


Expand Down

0 comments on commit 9cc3d6f

Please sign in to comment.