diff options
author | Yves Orton <demerphq@gmail.com> | 2014-09-17 04:10:35 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2014-09-17 04:47:34 +0200 |
commit | aa48e906ca55e0da8e1317549a4ddafff3837f3f (patch) | |
tree | 3c6fbea93985ace1aad976d20524d3066c43d8f3 /regcomp.h | |
parent | d3d47aac53402ea3d4836c60e3659dc927a9887c (diff) | |
download | perl-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.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |