Skip to content
New issue

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

Fix return value when tre_parse() hits the stack limit #96

Merged
merged 2 commits into from
Jun 30, 2024

Conversation

dag-erling
Copy link
Collaborator

No description provided.

@dag-erling dag-erling changed the title Fix return value when tre_parse() hits the stack limit. Fix return value when tre_parse() hits the stack limit Apr 26, 2024
@dag-erling dag-erling force-pushed the des/toolong branch 2 times, most recently from a68835d to 772406a Compare April 26, 2024 11:33
This adds a test case consisting of 2,048 left parens followed by 2,048 right parens.  It is syntactically correct and properly balanced but overflows the stack, so it should return REG_ESPACE, but instead it returnd REG_EPAREN.
* Remove redundant status check at the top of the loop.  It's already part of the loop condition.
* Check status immediately after the loop terminates, so if we hit the stack limit, we correctly return REG_ESPACE, not REG_EPAREN.
@dag-erling dag-erling merged commit 96b4cac into laurikari:master Jun 30, 2024
2 checks passed
@dag-erling dag-erling deleted the des/toolong branch July 30, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant