summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-12-03 22:42:26 +0000
committerPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-12-08 00:05:15 +0000
commit1dd1944b9e9757d121aa50a03029666ee4a07440 (patch)
tree1e9081530da05cb117aca1104907409d137b80ea /op.c
parentd2817bd771b5f4a948f1a5395803b7d795453c07 (diff)
downloadperl-1dd1944b9e9757d121aa50a03029666ee4a07440.tar.gz
Give blessed() the same TRUEBOOL optimisation that ref() has in boolean contexts
Diffstat (limited to 'op.c')
-rw-r--r--op.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/op.c b/op.c
index abf1a81031..3c119c2133 100644
--- a/op.c
+++ b/op.c
@@ -18263,7 +18263,10 @@ Perl_rpeep(pTHX_ OP *o)
}
case OP_REF:
- /* see if ref() is used in boolean context */
+ case OP_BLESSED:
+ /* if the op is used in boolean context, set the TRUEBOOL flag
+ * which enables an optimisation at runtime which avoids creating
+ * a stack temporary for known-true package names */
if ((o->op_flags & OPf_WANT) == OPf_WANT_SCALAR)
S_check_for_bool_cxt(o, 1, OPpTRUEBOOL, OPpMAYBE_TRUEBOOL);
break;