summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2014-09-17 04:10:35 +0200
committerYves Orton <demerphq@gmail.com>2014-09-17 04:47:34 +0200
commitaa48e906ca55e0da8e1317549a4ddafff3837f3f (patch)
tree3c6fbea93985ace1aad976d20524d3066c43d8f3 /regcomp.h
parentd3d47aac53402ea3d4836c60e3659dc927a9887c (diff)
downloadperl-aa48e906ca55e0da8e1317549a4ddafff3837f3f.tar.gz
change NODE_ALIGN_FILL to set flags to 0
In 075abff3 Andy Lester set the flags field of regops to default to 0xde. I find this really weird, and possibly dangerous, as it seems to me reasonable to assume a new regop would have this field set to 0, so that later on code can set it to something else if necessary. (Which is what I wanted to do.) Since nothing breaks if I set it to 0x0 and I find that to be a much more natural default than 0xde (the prefix of 0xdeadbeef), I am changing this to set it to 0.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/regcomp.h b/regcomp.h
index b8c2735968..d4d3a29545 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -309,7 +309,16 @@ struct regnode_ssc {
#define NEXT_OFF(p) ((p)->next_off)
#define NODE_ALIGN(node)
-#define NODE_ALIGN_FILL(node) ((node)->flags = 0xde) /* deadbeef */
+/* the following define was set to 0xde in 075abff3
+ * as part of some linting logic. I have set it to 0
+ * as otherwise in every place where we /might/ set flags
+ * we have to set it 0 explicitly, which duplicates
+ * assignments and IMO adds an unacceptable level of
+ * surprise to working in the regex engine. If this
+ * is changed from 0 then at the very least make sure
+ * that SBOL for /^/ sets the flags to 0 explicitly.
+ * -- Yves */
+#define NODE_ALIGN_FILL(node) ((node)->flags = 0)
#define SIZE_ALIGN NODE_ALIGN