In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/4e1ed312da261450ba45a56e7b6756a873678f52?hp=935d8e7269ade03fb8f5de3c2c0ffcf649231353>
- Log ----------------------------------------------------------------- commit 4e1ed312da261450ba45a56e7b6756a873678f52 Author: Karl Williamson <k...@cpan.org> Date: Thu Jun 1 10:44:08 2017 -0600 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. ----------------------------------------------------------------------- Summary of changes: utf8.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utf8.h b/utf8.h index b2e338a80a..7b2ba14aa9 100644 --- a/utf8.h +++ b/utf8.h @@ -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) -- Perl5 Master Repository