diff options
author | Karl Williamson <khw@cpan.org> | 2017-06-01 10:44:08 -0600 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2017-06-01 12:56:23 -0400 |
commit | 4e1ed312da261450ba45a56e7b6756a873678f52 (patch) | |
tree | 0369f121a87346343272e4ac827628a564158634 /utf8.h | |
parent | 935d8e7269ade03fb8f5de3c2c0ffcf649231353 (diff) | |
download | perl-4e1ed312da261450ba45a56e7b6756a873678f52.tar.gz |
utf8.h: Add parens around macro param in expansion
a6951642ede4abe605dcf0e94b74948e0a60a56b added an assertion to find bugs
in calling macros, and so far, instead, it found a bug in a macro. A
parameter needs to be enclosed in parens in case it is an expression, so
that precedence works.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -540,9 +540,10 @@ encoded as UTF-8. C<cp> is a native (ASCII or EBCDIC) code point if less than & UTF_CONTINUATION_MASK)) /* This works in the face of malformed UTF-8. */ -#define UTF8_IS_NEXT_CHAR_DOWNGRADEABLE(s, e) (UTF8_IS_DOWNGRADEABLE_START(*s) \ - && ( (e) - (s) > 1) \ - && UTF8_IS_CONTINUATION(*((s)+1))) +#define UTF8_IS_NEXT_CHAR_DOWNGRADEABLE(s, e) \ + ( UTF8_IS_DOWNGRADEABLE_START(*(s)) \ + && ( (e) - (s) > 1) \ + && UTF8_IS_CONTINUATION(*((s)+1))) /* Number of bytes a code point occupies in UTF-8. */ #define NATIVE_SKIP(uv) UVCHR_SKIP(uv) |