diff options
author | Karl Williamson <khw@cpan.org> | 2017-12-12 23:01:02 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-12-12 23:19:37 -0700 |
commit | 5eabe374afae7b84aa4ba5e13e5424865bc74fc1 (patch) | |
tree | 8b38a442c6c222883814da1883b8304f52b234d3 /inline.h | |
parent | addf67e13a08f45d3bb4c245c821b1ef2767c5a5 (diff) | |
download | perl-5eabe374afae7b84aa4ba5e13e5424865bc74fc1.tar.gz |
inline.h: Fix wrong order of shift and mask
I realized that one should mask before the shift in this macro that is
used in is_utf8_invariant_string_loc() and variant_under_utf8_count().
This would only show up on a 32-bit platform that doesn't have 64-bit
ability at all.
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -400,10 +400,10 @@ S_is_utf8_invariant_string_loc(const U8* const s, STRLEN len, const U8 ** ep) * or'ing together the lowest bits of 'x'. Hopefully the final term gets * optimized out completely on a 32-bit system, and its mask gets optimized out * on a 64-bit system */ -#define PERL_IS_SUBWORD_ADDR(x) (1 & ( PTR2nat(x) \ - | (PTR2nat(x) >> 1) \ - | ( (PTR2nat(x) >> 2) \ - & PERL_WORD_BOUNDARY_MASK))) +#define PERL_IS_SUBWORD_ADDR(x) (1 & ( PTR2nat(x) \ + | ( PTR2nat(x) >> 1) \ + | ( ( (PTR2nat(x) \ + & PERL_WORD_BOUNDARY_MASK) >> 2)))) /* Do the word-at-a-time iff there is at least one usable full word. That * means that after advancing to a word boundary, there still is at least a |