Skip to content

Commit 2f150dc

Browse files
committed
S_scan_const: Use utf8_to_uv_or_die not utf8n_to_uvchr
These should never fail, as the values were already checked in get_and_check_backslash_N_name(), and the to_uvchr() forms are all being replaced by the preferred to_uv() forms.
1 parent f60e301 commit 2f150dc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

toke.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4157,10 +4157,10 @@ S_scan_const(pTHX_ char *start)
41574157
char hex_string[2 * UTF8_MAXBYTES + 5];
41584158

41594159
/* Get the first character of the result. */
4160-
U32 uv = utf8n_to_uvchr((U8 *) str,
4161-
len,
4162-
&char_length,
4163-
UTF8_ALLOW_ANYUV);
4160+
U32 uv = utf8_to_uv_or_die(
4161+
(const U8 *) str,
4162+
(const U8 *) str_end,
4163+
&char_length);
41644164
/* Convert first code point to Unicode hex,
41654165
* including the boiler plate before it. */
41664166
output_length =
@@ -4181,10 +4181,10 @@ S_scan_const(pTHX_ char *start)
41814181
* its Unicode code point in hex */
41824182
while ((str += char_length) < str_end) {
41834183
const STRLEN off = d - SvPVX_const(sv);
4184-
U32 uv = utf8n_to_uvchr((U8 *) str,
4185-
str_end - str,
4186-
&char_length,
4187-
UTF8_ALLOW_ANYUV);
4184+
U32 uv = utf8_to_uv_or_die(
4185+
(const U8 *) str,
4186+
(const U8 *) str_end,
4187+
&char_length);
41884188
output_length =
41894189
my_snprintf(hex_string,
41904190
sizeof(hex_string),

0 commit comments

Comments
 (0)