mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8230829: Matcher matches a surrogate pair that crosses border of the region
Reviewed-by: naoto
This commit is contained in:
parent
e8ee2800f5
commit
5e7e0e7bbe
2 changed files with 24 additions and 6 deletions
|
@ -3931,12 +3931,14 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
|
|||
boolean match(Matcher matcher, int i, CharSequence seq) {
|
||||
if (i < matcher.to) {
|
||||
int ch = Character.codePointAt(seq, i);
|
||||
return predicate.is(ch) &&
|
||||
next.match(matcher, i + Character.charCount(ch), seq);
|
||||
} else {
|
||||
matcher.hitEnd = true;
|
||||
return false;
|
||||
i += Character.charCount(ch);
|
||||
if (i <= matcher.to) {
|
||||
return predicate.is(ch) &&
|
||||
next.match(matcher, i, seq);
|
||||
}
|
||||
}
|
||||
matcher.hitEnd = true;
|
||||
return false;
|
||||
}
|
||||
boolean study(TreeInfo info) {
|
||||
info.minLength++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue