diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2021-12-03 22:42:26 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2021-12-08 00:05:15 +0000 |
commit | 1dd1944b9e9757d121aa50a03029666ee4a07440 (patch) | |
tree | 1e9081530da05cb117aca1104907409d137b80ea /op.c | |
parent | d2817bd771b5f4a948f1a5395803b7d795453c07 (diff) | |
download | perl-1dd1944b9e9757d121aa50a03029666ee4a07440.tar.gz |
Give blessed() the same TRUEBOOL optimisation that ref() has in boolean contexts
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |