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

Fixes Switch Break Bug #460

Merged

Conversation

TobiasWienand
Copy link
Contributor

Bug can be seen when trying to compile Tests/FuzzilliTests/CompilerTests/switch_statements.js, which fails because "break statement outside of loop or switch", even though it isn't. This happens because breaks are expected in switch cases, rather than the switch block.

This was missed because compilation was succesful before moving the Analyzer changes to a separate branch and verification of the new ContextAnalyzer was only done with Tests/FuzzilliTests/AnalyzerTest.swift and not with Tests/CompilerTests/switch_statements.js

Bug can be seen when trying to compile Tests/FuzzilliTests/CompilerTests/switch_statements.js, which fails because "break statement outside of loop or switch", even though it isn't. This happens because breaks are expected in the switch cases, rather than the switch block. This was missed because compilation was succesful before making the Analyzer changes a seperate branch and verification of the new ContextAnalyzer was only done with Tests/FuzzilliTests/AnalyzerTest.swift and not with Tests/CompilerTests/switch_statements.js
@saelo saelo merged commit f6b1917 into googleprojectzero:main Nov 11, 2024
2 of 3 checks passed
@saelo
Copy link
Collaborator

saelo commented Nov 11, 2024

Ah good catch! Yeah I guess this happens in part because the .switchBlock context is not propagated into the cases, but I think that needs to be this way, otherwise we might end up with SwitchCase blocks inside other SwitchCase blocks, which isn't valid. Anyway, thanks for the fix!

parthdt pushed a commit to parthdt/fuzzilli that referenced this pull request Dec 14, 2024
Bug can be seen when trying to compile Tests/FuzzilliTests/CompilerTests/switch_statements.js, which fails because "break statement outside of loop or switch", even though it isn't. This happens because breaks are expected in the switch cases, rather than the switch block.
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