@@ -2983,18 +2983,14 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
2983
2983
U32 * errors ,
2984
2984
AV * * msgs )
2985
2985
{
2986
+ PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_MSGS ;
2987
+
2986
2988
/* This is the inlined portion of utf8n_to_uvchr_msgs. It handles the
2987
2989
* simple cases, and, if necessary calls a helper function to deal with the
2988
2990
* more complex ones. Almost all well-formed non-problematic code points
2989
2991
* are considered simple, so that it's unlikely that the helper function
2990
2992
* will need to be called. */
2991
2993
2992
- const U8 * const s0 = s ;
2993
- const U8 * send = s0 + curlen ;
2994
- UV uv ;
2995
-
2996
- PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_MSGS ;
2997
-
2998
2994
/* Assume that isn't malformed; the vast majority of calls won't be */
2999
2995
if (errors ) {
3000
2996
* errors = 0 ;
@@ -3003,6 +2999,7 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
3003
2999
* msgs = NULL ;
3004
3000
}
3005
3001
3002
+ const U8 * s0 ;
3006
3003
3007
3004
/* No calls from core pass in an empty string; non-core need a check */
3008
3005
#ifdef PERL_CORE
@@ -3023,6 +3020,9 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
3023
3020
return * s ;
3024
3021
}
3025
3022
3023
+ const U8 * send = s + curlen ;
3024
+ s0 = s ;
3025
+
3026
3026
/* This dfa is fast. If it accepts the input, it was for a
3027
3027
* well-formed, non-problematic code point, which can be returned
3028
3028
* immediately. Otherwise we call a helper function to figure out the
@@ -3040,7 +3040,7 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
3040
3040
* */
3041
3041
PERL_UINT_FAST8_T type = PL_strict_utf8_dfa_tab [* s ];
3042
3042
PERL_UINT_FAST8_T state = PL_strict_utf8_dfa_tab [256 + type ];
3043
- uv = (0xff >> type ) & NATIVE_UTF8_TO_I8 (* s );
3043
+ UV uv = (0xff >> type ) & NATIVE_UTF8_TO_I8 (* s );
3044
3044
3045
3045
while (state > 1 && ++ s < send ) {
3046
3046
type = PL_strict_utf8_dfa_tab [* s ];
0 commit comments