In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/1a7511606ba00a5c02bdde113dbf53d913b47fed?hp=5baf66636cdcd4a10ac35e5d3aaa57a7fe0b51d8>

- Log -----------------------------------------------------------------
commit 1a7511606ba00a5c02bdde113dbf53d913b47fed
Author: Daniel Dragan <bul...@hotmail.com>
Date:   Sun Apr 8 00:19:11 2018 -0400

    fix utf8.c overflowed VC6's preproc macro buffer and syntax errored
    
    Only happened with CFG=Debug/-DDEBUGGING. Non-debugging VC6 build not
    affected.
    
    cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT
    -DPERLDLL -DPERL_CORE  -Od -MD -Zi -DDEBUGGING  -DPERL_EXTERNAL_GLOB
    -DPERL_IS_MINIPERL -Fomini\utf8.obj -Fdmini\utf8.pdb ..\utf8.c
    utf8.c
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2143: syntax error : missing ')' before 'string'
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : error C2059: syntax error : ')'
    ..\utf8.c(4057) : error C2059: syntax error : ')'
    ..\utf8.c(4057) : error C2059: syntax error : ')'
    ..\utf8.c(4057) : error C2017: illegal escape sequence
    ..\utf8.c(4057) : fatal error C1013: compiler limit : too many open
    parentheses
    GNUmakefile:1439: recipe for target 'mini\utf8.obj' failed
    
    The VC6 C preprocessor breaks down and messes up the number of \s
    in escaping asserts in asserts in asserts to make a double quote string
    litteral for an assert message. VC7/VC 2003 doesn't have this problem.
    
    Fix the asserts in asserts by factoring out EIGHT_BIT_UTF8_TO_NATIVE
    macro which has asserts inside it from L1_func aka toFOLD_LC which is
    another macro that has asserts inside it.
    
    Some adtl details in RT ticket associated with the patch.

commit e5863284b4363af3830b13eb085532a3043c854e
Author: Karl Williamson <k...@cpan.org>
Date:   Thu Apr 5 08:27:32 2018 -0600

    PATCH: [perl #133037] new warning in inline.h
    
    This just uses an intermediate variable of the correct type to store the
    result, and then casts it, as the value is guaranteed to be a number
    between 0 and 7.

-----------------------------------------------------------------------

Summary of changes:
 inline.h | 4 +++-
 utf8.c   | 7 +++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/inline.h b/inline.h
index 8c20e7583a..dc74c2daed 100644
--- a/inline.h
+++ b/inline.h
@@ -641,9 +641,11 @@ S_variant_under_utf8_count(const U8* const s, const U8* 
const e)
         /* Process per-word as long as we have at least a full word left */
         do {    /* Commit 03c1e4ab1d6ee9062fb3f94b0ba31db6698724b1 contains an
                    explanation of how this works */
-            count += ((((* (PERL_UINTMAX_T *) x) & PERL_VARIANTS_WORD_MASK) >> 
7)
+            PERL_UINTMAX_T increment
+                = ((((* (PERL_UINTMAX_T *) x) & PERL_VARIANTS_WORD_MASK) >> 7)
                       * PERL_COUNT_MULTIPLIER)
                     >> ((PERL_WORDSIZE - 1) * CHARBITS);
+            count += (Size_t) increment;
             x += PERL_WORDSIZE;
         } while (x + PERL_WORDSIZE <= e);
     }
diff --git a/utf8.c b/utf8.c
index 94e3267f4f..f7b96384d5 100644
--- a/utf8.c
+++ b/utf8.c
@@ -3881,13 +3881,12 @@ S_check_and_deprecate(pTHX_ const U8 *p,
         }                                                                    \
     }                                                                        \
     else if UTF8_IS_NEXT_CHAR_DOWNGRADEABLE(p, e) {                          \
+        U8 c = EIGHT_BIT_UTF8_TO_NATIVE(*p, *(p+1));                         \
         if (flags & (locale_flags)) {                                        \
-            result = LC_L1_change_macro(EIGHT_BIT_UTF8_TO_NATIVE(*p,         \
-                                                                 *(p+1)));   \
+            result = LC_L1_change_macro(c);                                  \
         }                                                                    \
         else {                                                               \
-            return L1_func(EIGHT_BIT_UTF8_TO_NATIVE(*p, *(p+1)),             \
-                           ustrp, lenp,  L1_func_extra_param);               \
+            return L1_func(c, ustrp, lenp,  L1_func_extra_param);            \
         }                                                                    \
     }                                                                        \
     else {  /* malformed UTF-8 or ord above 255 */                           \

-- 
Perl5 Master Repository

Reply via email to