-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
A few small bugfixes #490
A few small bugfixes #490
Conversation
Spotted by @pierreganty (#478), thank you
Spotted by @sw17ch, thank you.
Spotted by @sw17ch, thank you.
Previously this gave: ``` ; ./build/bin/re -r literal -G 3 abc ; ./build/bin/re -r literal -G 4 abc abc ; ``` and now -G 3 does construct "abc" (not including the newline, which is a property of the printing, not of the constructed string): ``` ; ./build/bin/re -r literal -G 3 abc abc ; ./build/bin/re -r literal -G 4 abc abc ; ``` and: ``` ; ./build/bin/re -r native -G 3 '^x+$' x xx xxx ``` Spotted by @pierreganty (#478), thank you
if (ctx->buf_used + ctx->sed[sf->s_id] >= ctx->max_length) { | ||
LOG(2, "PRUNING due to max length: used:%zu + sed[%d]:%u >= max_length:%zu\n", | ||
if (ctx->buf_used + ctx->sed[sf->s_id] > ctx->max_length) { | ||
LOG(2, "PRUNING due to max length: used:%zu + sed[%d]:%u > max_length:%zu\n", |
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.
@silentbicycle requesting your review for this please, I was unsure about this.
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 think >
is correct here -- this means "if the buffer used so far plus what we'd need for the shortest distance to an end state exceeds the available buffer". re -G 5 '^abcde'
should produce "abcde" as a valid 5-character match (which is rejected with >=
), not counting the trailing \0
, but reject re -G 5 '^abcdef'
.
This doesn't help for #317, but whatever the solution is there, asserting about it is the wrong thing to do. Spotted by @classabbyamp, thank you
I have extremely broken the iprange example. I am very unsure what's going on with this program.
if (ctx->buf_used + ctx->sed[sf->s_id] >= ctx->max_length) { | ||
LOG(2, "PRUNING due to max length: used:%zu + sed[%d]:%u >= max_length:%zu\n", | ||
if (ctx->buf_used + ctx->sed[sf->s_id] > ctx->max_length) { | ||
LOG(2, "PRUNING due to max length: used:%zu + sed[%d]:%u > max_length:%zu\n", |
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 think >
is correct here -- this means "if the buffer used so far plus what we'd need for the shortest distance to an end state exceeds the available buffer". re -G 5 '^abcde'
should produce "abcde" as a valid 5-character match (which is rejected with >=
), not counting the trailing \0
, but reject re -G 5 '^abcdef'
.
-G length
inconsistent, moreover returns error code. #478, off-by-one forre -G <max-length>
and also in the same ticket, wrong exit status forre -G
-C opt-level=3
does help for performance of rust generated code, and I'd also hoped it'd improve time in CI. But sadly no, that's still dominated by the rustc compile time.