summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2021-03-18 14:37:01 +1100
committerYves Orton <demerphq@gmail.com>2022-10-26 11:11:08 +0200
commita73e2f42e4d90aabd3c1f9b45b5b18fab652e36e (patch)
treea49777fb3f48fdde784a7b68b567053ed91c2379 /op.c
parentee05e6d8953bcb0842d59e3379842b4df6929b1a (diff)
downloadperl-a73e2f42e4d90aabd3c1f9b45b5b18fab652e36e.tar.gz
op.c - copy cop_features to the COP inserted into the OP tree
All current features are compile-time, so this hasn't been an issue, but my current implementation of the autovivification issue checks features at runtime, which failed to work correctly if non-bundle features were set. This commit fixes things so that run-time default-on features also work properly, by setting each COP's cop_features to the value of the bits set at the COP's compile time - ie the same approach as cop_hints.
Diffstat (limited to 'op.c')
-rw-r--r--op.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/op.c b/op.c
index f67d38cf68..481158db3f 100644
--- a/op.c
+++ b/op.c
@@ -8225,6 +8225,7 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o)
cop->cop_seq = seq;
cop->cop_warnings = DUP_WARNINGS(PL_curcop->cop_warnings);
CopHINTHASH_set(cop, cophh_copy(CopHINTHASH_get(PL_curcop)));
+ CopFEATURES_setfrom(cop, PL_curcop);
if (label) {
Perl_cop_store_label(aTHX_ cop, label, strlen(label), utf8);