mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibRegex: Ensure nullable quantifiers backtrack when input remains
Makes patterns like `/(a?b??)*/` correctly match the string
This commit is contained in:
parent
40c71ff3c0
commit
61744322ad
Notes:
github-actions[bot]
2025-03-02 14:20:04 +00:00
Author: https://github.com/aplefull
Commit: 61744322ad
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3752
Reviewed-by: https://github.com/alimpfard
2 changed files with 13 additions and 0 deletions
|
@ -1118,6 +1118,10 @@ ALWAYS_INLINE ExecutionResult OpCode_JumpNonEmpty::execute(MatchInput const& inp
|
|||
}
|
||||
}
|
||||
|
||||
if (state.string_position < input.view.length()) {
|
||||
return ExecutionResult::Failed_ExecuteLowPrioForks;
|
||||
}
|
||||
|
||||
return ExecutionResult::Continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue