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

JavaScript: Distinguish {lo} and {lo,} in the regular expression parser. #2854

Merged

Conversation

max-schaefer
Copy link
Collaborator

No description provided.

@max-schaefer max-schaefer requested a review from a team as a code owner February 17, 2020 08:25
Copy link
Contributor

@esbena esbena left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for jumping in and fixing this immediately.

@@ -0,0 +1,3 @@
/a{1}/;
/a{1,}/;
/a{1,5}/;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the non-bound /a{,1}/; for completeness?

(/a{,1}/.test('a{,1}') === true)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a syntax error, I believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I may be wrong, let me check...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And indeed I'm wrong, we are more lenient than the ECMAScript standard. Yay, us!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apparently we treat a missing lower bound as zero, which is not how v8 handles it. That is, however, orthogonal to this PR.

@max-schaefer max-schaefer force-pushed the js/regexp-bounded-quantifier-fix branch from c127ee1 to cd1b5ca Compare February 17, 2020 08:57
esbena
esbena previously approved these changes Feb 17, 2020
esbena
esbena previously approved these changes Feb 18, 2020
@max-schaefer max-schaefer force-pushed the js/regexp-bounded-quantifier-fix branch from 00dc26b to 4346691 Compare February 19, 2020 08:26
@semmle-qlci semmle-qlci merged commit 5e0f21a into github:master Feb 19, 2020
@max-schaefer max-schaefer deleted the js/regexp-bounded-quantifier-fix branch March 19, 2020 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants