Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S_scan_const: Use utf8_to_uv_or_die not utf8n_to_uvchr #23080

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions toke.c
Original file line number Diff line number Diff line change
@@ -4155,10 +4155,10 @@ S_scan_const(pTHX_ char *start)
char hex_string[2 * UTF8_MAXBYTES + 5];

/* Get the first character of the result. */
U32 uv = utf8n_to_uvchr((U8 *) str,
len,
&char_length,
UTF8_ALLOW_ANYUV);
U32 uv = utf8_to_uv_or_die(
(const U8 *) str,
(const U8 *) str_end,
&char_length);
/* Convert first code point to Unicode hex,
* including the boiler plate before it. */
output_length =
@@ -4179,10 +4179,10 @@ S_scan_const(pTHX_ char *start)
* its Unicode code point in hex */
while ((str += char_length) < str_end) {
const STRLEN off = d - SvPVX_const(sv);
U32 uv = utf8n_to_uvchr((U8 *) str,
str_end - str,
&char_length,
UTF8_ALLOW_ANYUV);
U32 uv = utf8_to_uv_or_die(
(const U8 *) str,
(const U8 *) str_end,
&char_length);
output_length =
my_snprintf(hex_string,
sizeof(hex_string),