-
Notifications
You must be signed in to change notification settings - Fork 243
Remove dead code for handling quantifier after OP_FAIL #570
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
Remove dead code for handling quantifier after OP_FAIL #570
Conversation
zherczeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7c9bf02 to
7063183
Compare
| #ifdef DEBUG_SHOW_PARSED | ||
| fprintf(stderr, "** Unrecognized parsed pattern item 0x%.8x\n", *pptr); | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dunno why this DEBUG code was added, but why not keep it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced it with an UNREACHABLE assertion. The printf is currently disabled, so if the condition is hit, you won't see the logging. The assertion is nice and noisy, so will help development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if by disabled you mean that there is a commented out:
#define DEBUG_SHOW_PARSED 1then that is by design, as those are usually enabled on demand when additional debugging is needed
I Presume that Philip (or whoever uses that) would rather have a printf than an abort though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an abort because it's unreachable code, which should always generate an error during development, not just when "DEBUG_SHOW_PARSED" has been set (which no-one is likely to set).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEBUG_SHOW_PARSED is an ancient debugging feature that I put in when I was adding the initial parsing pre-pass for 10.23 and I wanted to see what its output was. I didn't think it would be of general use afterwards which is why I didn't imiplement anything more elaborate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some updates there but never actually tried it. Is there anybody using it?
Fixes PCRE2Project#541 Also add further debug assertions to internal error paths.
7063183 to
4fc85b0
Compare
Fixes #541