diff options
author | Karl Williamson <khw@cpan.org> | 2015-12-26 11:47:26 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-12-26 12:57:41 -0700 |
commit | 0effac6071c5a0244f527fa9e019938a107ab9ac (patch) | |
tree | b62383cfbdb705be00c25465dda848366c59aae8 /regcomp.h | |
parent | 4cbce0a6b377e059ea536b5671a097422d236ec2 (diff) | |
download | perl-0effac6071c5a0244f527fa9e019938a107ab9ac.tar.gz |
regcomp.h: Fix shift and mask
The mask removed here was to make sure that right shifting didn't
propagate the sign bit, but is unnecessary as the value shifted is
unsigned. And confining things to a U8 with that mask assumes that the
bit vector being operated on has 256 elements max. This isn't
necessarily true these days, as one can change ANYOF_BITMAP_SIZE.
In fact changing that number was failing until this commit.
It also adds white space to make it easier to read.
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -917,7 +917,7 @@ typedef struct _reg_ac_data reg_ac_data; #define IS_TRIE_AC(op) ((op)>=AHOCORASICK) -#define BITMAP_BYTE(p, c) (((U8*)p)[(((U8)(c)) >> 3) & 31]) +#define BITMAP_BYTE(p, c) (( (U8*) p) [ ( ( (UV) (c)) >> 3) ] ) #define BITMAP_TEST(p, c) (BITMAP_BYTE(p, c) & ANYOF_BIT((U8)c)) /* these defines assume uniquecharcount is the correct variable, and state may be evaluated twice */ |