Skip to content

regexp: fixed the zero advance logic in quantifiers #534

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

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Sep 13, 2024

@saghul saghul force-pushed the zero-advance-logic-in-quantifiers branch from 442842d to 8f6b41e Compare September 13, 2024 21:40
@@ -33205,7 +33205,7 @@ typedef enum BCTagEnum {
BC_TAG_SET,
} BCTagEnum;

#define BC_VERSION 13
#define BC_VERSION 14
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The generated bytecode changed, so I bumped the version.

Comment on lines +1653 to +1654
s->byte_code.buf[pos++] = REOP_push_char_pos;
re_emit_op(s, REOP_check_advance);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't fully understand why this puts the REOP_check_advance at the end of the buffer while everything else is inserted before the end. Is pos == s->byte_code.size on the second line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll admit I have no idea, I just ported the fix and ran the tests 😅

@saghul saghul merged commit 5f51707 into master Sep 14, 2024
50 checks passed
@saghul saghul deleted the zero-advance-logic-in-quantifiers branch September 14, 2024 20:00
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