mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibRegex: Use the *actually* correct repeat start offset for Repeat
Fixes #2931 and various frequent crashes.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
5c032583b4
commit
50733c564c
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user