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 #227 #228

Closed
wants to merge 2 commits into from
Closed

fix #227 #228

wants to merge 2 commits into from

Conversation

cmazakas
Copy link
Member

@cmazakas cmazakas commented Nov 1, 2024

This PR contains a draft of a fix for issue #227. I call it a draft because while the condition seems to fix the issue and all the tests pass, I have no idea why it works or why it's correct.

@jzmaddock hopefully this "fix" will help give you some insight as to how I should clean this up.

Edit:

Before we merge, let me squash all the commits in this branch.

@jzmaddock
Copy link
Collaborator

No. I don't know why it works either... except that it avoids the issue rather than fixes it because the call to match_endmark at line 1190 for sub-expression $1 is not reached any more with the change in place. This is why I hate fuzzer derived test cases (and some of the fancier Perl extensions) as they generate state machines which no mere mortal can understand! Actually, this one should be simple enough to figure out eventually... but whether it's worth the time is another matter.

For preference I would remove the if (idx == -5) check and call match_startmark unconditionally here: in general match_startmark and match_endmark calls should always be balanced: if they're not then something has gone wrong! So that piece of code looks suspicious to me anyway (the tests all pass with that change too).

BTW the Jamfile for test_grep had got badly broken recently with the Boost.Build changes, I've just pushed a fix for that.

@cmazakas
Copy link
Member Author

cmazakas commented Nov 4, 2024

For preference I would remove the if (idx == -5) check and call match_startmark unconditionally here: in general match_startmark and match_endmark calls should always be balanced: if they're not then something has gone wrong! So that piece of code looks suspicious to me anyway (the tests all pass with that change too).

I tried this initially but it made quite a few tests fail. Using the conditional check, everything passes.

@jzmaddock
Copy link
Collaborator

That's weird, see: #230

@cmazakas
Copy link
Member Author

cmazakas commented Nov 4, 2024

Closing in favor of your PR, John

@cmazakas cmazakas closed this Nov 4, 2024
@cmazakas cmazakas deleted the feature/fuzzing-fixes branch November 4, 2024 17:34
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