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 bug when building without alloca #114

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

dag-erling
Copy link
Collaborator

In tre_match(), there is a spot where we check if the provided source is capable of rewinding, and return if it isn't. Due to missing braces, that return becomes unconditional when TRE_USE_ALLOCA is false. As a result, calling regexec() with a regex that includes back references always fails with REG_BADPAT.

In `tre_match()`, there is a spot where we check if the provided source
is capable of rewinding, and return if it isn't.  Due to missing braces,
that return becomes unconditional when `TRE_USE_ALLOCA` is false.  As a
result, calling `regexec()` with a regex that includes back references
always fails with `REG_BADPAT`.

Fixes: 6f09108
@trushworth
Copy link
Collaborator

Yes, this is exactly the problem and fix I described.

@trushworth
Copy link
Collaborator

How would you prefer this to be merged? All three options look reasonable to me, and my git knowledge is not enough to say which might be better.

Copy link
Collaborator

@trushworth trushworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh. I was looking in the wrong place on the screen for how to review :(.

This is exactly the problem I was talking about and the fix I proposed. Let's do it.

@dag-erling dag-erling merged commit 9c3c093 into laurikari:master Sep 10, 2024
2 checks passed
@dag-erling dag-erling deleted the des/no-alloca-bug branch September 10, 2024 22:06
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.

2 participants