Skip to content

Commit 1cd3710

Browse files
committed
S_reginclass: Use utf8_to_uv_or_die
This new function is equivalent to the several lines it replaces
1 parent c08f688 commit 1cd3710

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

regexec.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10936,14 +10936,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const
1093610936
* UTF8_IS_INVARIANT() works even if not in UTF-8 */
1093710937
if (! UTF8_IS_INVARIANT(c) && utf8_target) {
1093810938
STRLEN c_len = 0;
10939-
const U32 utf8n_flags = UTF8_ALLOW_DEFAULT;
10940-
c = utf8n_to_uvchr(p, p_end - p, &c_len, utf8n_flags | UTF8_CHECK_ONLY);
10941-
if (c_len == (STRLEN)-1) {
10942-
force_out_malformed_utf8_message_(p, p_end,
10943-
utf8n_flags,
10944-
MALFORMED_UTF8_DIE);
10945-
NOT_REACHED; /* NOTREACHED */
10946-
}
10939+
c = utf8_to_uv_or_die(p, p_end, &c_len);
1094710940
if ( c > 255
1094810941
&& (OP(n) == ANYOFL || OP(n) == ANYOFPOSIXL)
1094910942
&& ! (flags & ANYOFL_UTF8_LOCALE_REQD))

0 commit comments

Comments
 (0)