mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibRegex: Correctly calculate the target for Repeat in table alts
Fixes a bunch of websites breaking because we now verify jump offsets by trying to remove 0-offset jumps. This has been broken for a good while, it was just rare to see Repeat inside alternatives that lended themselves well to tree alts.
This commit is contained in:
parent
8f20899533
commit
fca1d33fec
Notes:
github-actions[bot]
2025-04-24 07:18:25 +00:00
Author: https://github.com/alimpfard
Commit: fca1d33fec
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4454
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 11 additions and 1 deletions
|
@ -1285,3 +1285,12 @@ TEST_CASE(mismatching_brackets)
|
|||
EXPECT_EQ(re.parser_result.error, regex::Error::MismatchingBracket);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(optimizer_repeat_offset)
|
||||
{
|
||||
{
|
||||
// Miscalculating the repeat offset in table reconstruction of alternatives would lead to crash here
|
||||
// make sure that doesn't happen :)
|
||||
Regex<ECMA262> re("\\/?\\??#?([\\/?#]|[\\uD800-\\uDBFF]|%[c-f][0-9a-f](%[89ab][0-9a-f]){0,2}(%[89ab]?)?|%[0-9a-f]?)$"sv);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue