mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-10880 Fix a potential infinite loop
X-SVN-Rev: 36179
This commit is contained in:
parent
12a1765e44
commit
a1213c49b1
1 changed files with 2 additions and 2 deletions
|
@ -727,7 +727,7 @@ public class PluralFormat extends UFormat {
|
|||
int matchedIndex = -1;
|
||||
// Iterate over (ARG_SELECTOR ARG_START message ARG_LIMIT) tuples
|
||||
// until the end of the plural-only pattern.
|
||||
do {
|
||||
while (partIndex < count) {
|
||||
MessagePattern.Part partSelector=msgPattern.getPart(partIndex++);
|
||||
if (partSelector.getType() != MessagePattern.Part.Type.ARG_SELECTOR) {
|
||||
// Bad format
|
||||
|
@ -760,7 +760,7 @@ public class PluralFormat extends UFormat {
|
|||
matchedWord = currArg;
|
||||
keyword = pattern.substring(partStart.getLimit(), partLimit.getIndex());
|
||||
}
|
||||
} while(partIndex<count);
|
||||
}
|
||||
if (keyword != null) {
|
||||
pos.setBeginIndex(matchedIndex);
|
||||
pos.setEndIndex(matchedIndex + matchedWord.length());
|
||||
|
|
Loading…
Add table
Reference in a new issue