mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibRegex: Use the *actually* correct repeat start offset for Repeat
Fixes #2931 and various frequent crashes.
This commit is contained in:
parent
5c032583b4
commit
50733c564c
Notes:
github-actions[bot]
2024-12-23 12:14:51 +00:00
Author: https://github.com/alimpfard
Commit: 50733c564c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3019
Reviewed-by: https://github.com/gmta ✅
2 changed files with 6 additions and 1 deletions
|
@ -98,7 +98,7 @@ typename Regex<Parser>::BasicBlockList Regex<Parser>::split_basic_blocks(ByteCod
|
|||
case OpCodeId::Repeat: {
|
||||
// Repeat produces two blocks, one containing its repeated expr, and one after that.
|
||||
auto& repeat = static_cast<OpCode_Repeat const&>(opcode);
|
||||
auto repeat_start = state.instruction_position - repeat.offset() - repeat.size();
|
||||
auto repeat_start = state.instruction_position - repeat.offset();
|
||||
if (repeat_start > end_of_last_block)
|
||||
block_boundaries.append({ end_of_last_block, repeat_start, "Repeat"sv });
|
||||
block_boundaries.append({ repeat_start, state.instruction_position, "Repeat after"sv });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue