8276694: Pattern trailing unescaped backslash causes internal error

Reviewed-by: jlaskey
This commit is contained in:
Masanori Yano 2022-01-11 22:37:15 +00:00 committed by Ian Graves
parent 36f41cbe11
commit 3aaa0982d8
2 changed files with 12 additions and 1 deletions

View file

@ -1795,6 +1795,8 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
if (patternLength != cursor) {
if (peek() == ')') {
throw error("Unmatched closing ')'");
} else if (cursor == patternLength + 1 && temp[patternLength - 1] == '\\') {
throw error("Unescaped trailing backslash");
} else {
throw error("Unexpected internal error");
}