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

fuzz-js #255

Closed
bakkot opened this issue Apr 4, 2023 · 9 comments
Closed

fuzz-js #255

bakkot opened this issue Apr 4, 2023 · 9 comments
Assignees
Labels
A-parser Area - Parser C-bug Category - Bug P-high Priority - High

Comments

@bakkot
Copy link

bakkot commented Apr 4, 2023

async is, alas, a legal identifier in JS, which means all of the following are valid programs:

async(...null)
null?async():null
switch(null){case async():}

But they're all rejected by the parser (or at least the version of it on Cargo).

I found these with a fuzzer; if you'd like me not to file bugs found by a fuzzer, let me know.

@Boshen
Copy link
Member

Boshen commented Apr 5, 2023

Thank you for fuzzing oxc! I did a basic triage and found the parser cannot distinguish whether these are async functions or not. I'll try and get a fix soon.

@Boshen Boshen added C-bug Category - Bug P-high Priority - High A-parser Area - Parser labels Apr 5, 2023
Boshen added a commit that referenced this issue Apr 5, 2023
Boshen added a commit that referenced this issue Apr 5, 2023
@Boshen Boshen self-assigned this Apr 5, 2023
Boshen added a commit that referenced this issue Apr 5, 2023
* fix(parser): parse `async(...null)` as call expression

relates #255

* fix(parser): parse `null?async():null`

relates #255
@Boshen
Copy link
Member

Boshen commented Apr 5, 2023

@bakkot I published the latest fixes

oxc_ast = "0.0.4"
oxc_parser = "0.0.4"

@Boshen
Copy link
Member

Boshen commented Apr 5, 2023

I couldn't try fuzz-js due to unpublished version of shift-shrink@2.0.0

@bakkot
Copy link
Author

bakkot commented Apr 5, 2023

That does seem to have fixed the async issues! Now the fuzzer gets further and has encountered another class of failures:

for(var[l=null in null]in null);
for(new null(null in null);;);
for(`${null in null}`;;);
for(new null(null in null)._ in null);

I couldn't try fuzz-js due to unpublished version of shift-shrink@2.0.0

Lol, whoops, I'll get that published later today.

Boshen added a commit that referenced this issue Apr 6, 2023
Boshen added a commit that referenced this issue Apr 6, 2023
Boshen added a commit that referenced this issue Apr 6, 2023
Boshen added a commit that referenced this issue Apr 6, 2023
Boshen added a commit that referenced this issue Apr 6, 2023
@Boshen Boshen changed the title some fuzzer-identified parse failures around use of async as the name of a function fuzz-js Apr 10, 2023
@Boshen
Copy link
Member

Boshen commented Apr 10, 2023

@bakkot I published the latest fixes

oxc_ast = "0.0.5"
oxc_parser = "0.0.5"

Still waiting for shift-shrink@2.0.0 😁

@bakkot
Copy link
Author

bakkot commented Apr 13, 2023

Sorry for the delay; there's some stuff blocking. I'll ping you when I get it actually released.

@bakkot
Copy link
Author

bakkot commented Sep 9, 2023

Well, that took an embarrassingly long time, but shift-shrink 2.0.0 is now published.

@Boshen Boshen reopened this Sep 9, 2023
@Boshen
Copy link
Member

Boshen commented Sep 9, 2023

@bakkot Thank you, it's running locally.

@Boshen
Copy link
Member

Boshen commented Sep 9, 2023

@Boshen Boshen closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser C-bug Category - Bug P-high Priority - High
Projects
None yet
Development

No branches or pull requests

2 participants