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

is_utf8_common: Use utf8_to_uv() #22831

Draft
wants to merge 1 commit into
base: blead
Choose a base branch
from
Draft
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
9 changes: 4 additions & 5 deletions utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -3725,15 +3725,14 @@ PERL_STATIC_INLINE bool
S_is_utf8_common(pTHX_ const U8 *const p, const U8 * const e,
SV* const invlist)
{
PERL_ARGS_ASSERT_IS_UTF8_COMMON;

/* returns a boolean giving whether or not the UTF8-encoded character that
* starts at <p>, and extending no further than <e - 1> is in the inversion
* list <invlist>. */

UV cp = utf8n_to_uvchr(p, e - p, NULL, 0);

PERL_ARGS_ASSERT_IS_UTF8_COMMON;

if (cp == 0 && (p >= e || *p != '\0')) {
UV cp;
if (! utf8_to_uv(p, e, &cp, NULL)) {
_force_out_malformed_utf8_message(p, e, 0, MALFORMED_UTF8_DIE);
NOT_REACHED; /* NOTREACHED */
}
Expand Down
Loading