Skip to content

regmatch: Use new utf8_to_uv #22834

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

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
13 changes: 7 additions & 6 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -6984,10 +6984,10 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)

while (chars) {
if (utf8_target) {
/* XXX This assumes the length is well-formed, as
* does the UTF8SKIP below */
uvc = utf8n_to_uvchr((U8*)uc, UTF8_MAXLEN, &len,
uniflags);
(void) utf8_to_uv_flags((U8*)uc, uc + UTF8_MAXLEN,
&uvc, &len,
( uniflags|UTF8_DIE_IF_MALFORMED
|UTF8_NO_CONFIDENCE_IN_CURLEN_));
uc += len;
}
else {
Expand All @@ -6999,8 +6999,9 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
while (foldlen) {
if (!--chars)
break;
uvc = utf8n_to_uvchr(uscan, foldlen, &len,
uniflags);
(void) utf8_to_uv_flags((U8*)uscan,
uscan + foldlen, &uvc, &len,
uniflags|UTF8_DIE_IF_MALFORMED);
uscan += len;
foldlen -= len;
}
Expand Down
Loading