Skip to content

Commit 4acc9fb

Browse files
committed
utf8n_to_uvchr_msgs: Widen declaration to U16.
Testing on an EBCDIC box showed that this was too narrow.
1 parent 1067e02 commit 4acc9fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inline.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -3109,9 +3109,11 @@ Perl_utf8n_to_uvchr_msgs(const U8 * const s0,
31093109
*
31103110
* The terminology of the dfa refers to a 'class'. The variable 'type'
31113111
* would have been named 'class' except that is a reserved word in C++
3112-
* */
3112+
*
3113+
* The table can be a U16 on EBCDIC platforms, so 'state' is declared
3114+
* as U16; 'type' is likely to never occupy more than 5 bits. */
31133115
PERL_UINT_FAST8_T type = PL_strict_utf8_dfa_tab[*s];
3114-
PERL_UINT_FAST8_T state = PL_strict_utf8_dfa_tab[256 + type];
3116+
PERL_UINT_FAST16_T state = PL_strict_utf8_dfa_tab[256 + type];
31153117
UV uv = (0xff >> type) & NATIVE_UTF8_TO_I8(*s);
31163118

31173119
while (state > 1 && ++s < send) {

0 commit comments

Comments
 (0)