LibRegex: Fix handling of + quantifier with zero-width matches
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macOS, macos-15, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macOS, macOS-arm64, macos-15) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, Linux, Linux-x86_64, blacksmith-8vcpu-ubuntu-2404) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

Small change that allows quantifiers using Fork* forms (e.g., +) to
succeed after one match, even if that match has zero width.
This commit is contained in:
aplefull 2025-05-31 19:49:43 +02:00 committed by Ali Mohammad Pur
parent 2380fb0ca1
commit 486602e796
Notes: github-actions[bot] 2025-06-02 13:53:33 +00:00
2 changed files with 15 additions and 2 deletions

View file

@ -1121,9 +1121,8 @@ ALWAYS_INLINE ExecutionResult OpCode_JumpNonEmpty::execute(MatchInput const& inp
}
}
if (state.string_position < input.view.length()) {
if (form() == OpCodeId::Jump && state.string_position < input.view.length())
return ExecutionResult::Failed_ExecuteLowPrioForks;
}
return ExecutionResult::Continue;
}