summaryrefslogtreecommitdiff
path: root/cop.h
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 /cop.h
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 'cop.h')
-rw-r--r--cop.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cop.h b/cop.h
index ab6f507b20..f53f6aa7cb 100644
--- a/cop.h
+++ b/cop.h
@@ -558,6 +558,8 @@ string C<p>, creating the package if necessary.
#define CopHINTHASH_get(c) ((COPHH*)((c)->cop_hints_hash))
#define CopHINTHASH_set(c,h) ((c)->cop_hints_hash = (h))
+#define CopFEATURES_setfrom(dst, src) ((dst)->cop_features = (src)->cop_features)
+
/*
=for apidoc Am|SV *|cop_hints_fetch_pv |const COP *cop|const char *key |U32 hash|U32 flags
=for apidoc_item|SV *|cop_hints_fetch_pvn|const COP *cop|const char *key|STRLEN keylen|U32 hash|U32 flags