mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
LibRegex: Bail parsing class set characters upon early EOF
Otherwise, we reach a skip() invocation at the end of this function, which crashes due to EOF. Caught by test262.
This commit is contained in:
parent
32502fceed
commit
8b668da9d5
2 changed files with 22 additions and 0 deletions
|
@ -2224,6 +2224,11 @@ Optional<u32> ECMA262Parser::parse_class_set_character()
|
|||
"&&"sv, "!!"sv, "##"sv, "$$"sv, "%%"sv, "**"sv, "++"sv, ",,"sv, ".."sv, "::"sv, ";;"sv, "<<"sv, "=="sv, ">>"sv, "??"sv, "@@"sv, "^^"sv, "``"sv, "~~"sv
|
||||
};
|
||||
|
||||
if (done()) {
|
||||
set_error(Error::InvalidPattern);
|
||||
return {};
|
||||
}
|
||||
|
||||
auto start_position = tell();
|
||||
ArmedScopeGuard restore { [&] { back(tell() - start_position + 1); } };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue