We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following reproducer:
#[test] fn test_effect_of_backtrack_limit() { const INPUT_LIMIT: usize = 10; const INPUT_SIZE: usize = 100; let regex = RegexBuilder::new(r"(a|b|ab)*(?=c)") .backtrack_limit(INPUT_LIMIT) .build() .expect("Failed to build regex") .clone(); let input = "ab".repeat(INPUT_SIZE) + "c"; assert!(regex.is_match(&input).is_err(), "Should throw"); }
fails correctly at
if backtrack_count > options.backtrack_limit { return Err(Error::RuntimeError(RuntimeError::BacktrackLimitExceeded)); }
but if we increase the SIZE and make the limit a lot bigger, it should not throw, but it panics (is it a simple stack overflow now?):
#[test] fn test_effect_of_backtrack_limit() { const INPUT_LIMIT: usize = 10_000_000; const INPUT_SIZE: usize = 1_000_000; let regex = RegexBuilder::new(r"(a|b|ab)*(?=c)") .backtrack_limit(INPUT_LIMIT) .build() .expect("Failed to build regex") .clone(); let input = "ab".repeat(INPUT_SIZE) + "c"; assert!(regex.is_match(&input).is_ok(), "Should not throw"); }
Is there a way to increase the backtracking limit to 10 million in e.g. openai/tiktoken#245?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following reproducer:
fails correctly at
but if we increase the SIZE and make the limit a lot bigger, it should not throw, but it panics (is it a simple stack overflow now?):
Is there a way to increase the backtracking limit to 10 million in e.g. openai/tiktoken#245?
The text was updated successfully, but these errors were encountered: