mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 21:37:58 +03:00
LibRegex: Account for eof after \<x> when 'x' leads to legacy behaviour
This commit is contained in:
parent
48442059fc
commit
660d2b53b1
Notes:
sideshowbarker
2024-07-17 07:14:34 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/660d2b53b1 Pull-request: https://github.com/SerenityOS/serenity/pull/15148
@ -603,6 +603,7 @@ TEST_CASE(ECMA262_parse)
|
|||||||
{ "(?<𝓑𝓻𝓸𝔀𝓷>a)"sv },
|
{ "(?<𝓑𝓻𝓸𝔀𝓷>a)"sv },
|
||||||
{ "((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})"sv, regex::Error::NoError, ECMAScriptFlags::BrowserExtended }, // #12373, quantifiable assertions.
|
{ "((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})"sv, regex::Error::NoError, ECMAScriptFlags::BrowserExtended }, // #12373, quantifiable assertions.
|
||||||
{ parse_test_case_long_disjunction_chain.view() }, // A whole lot of disjunctions, should not overflow the stack.
|
{ parse_test_case_long_disjunction_chain.view() }, // A whole lot of disjunctions, should not overflow the stack.
|
||||||
|
{ "(\"|')(?:(?!\\2)[^\\\\\\r\\n]|\\\\.)*\\2"sv, regex::Error::NoError, ECMAScriptFlags::BrowserExtended }, // LegacyOctalEscapeSequence should not consume too many chars (and should not crash)
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto& test : tests) {
|
for (auto& test : tests) {
|
||||||
|
@ -1582,7 +1582,7 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If not, put the characters back.
|
// If not, put the characters back.
|
||||||
back(escape_str.length());
|
back(escape_str.length() + (done() ? 0 : 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<CompareTypeAndValuePair> escape_compares;
|
Vector<CompareTypeAndValuePair> escape_compares;
|
||||||
|
Loading…
Reference in New Issue
Block a user