googleprojectzero / googleprojectzero/fuzzilli
Switch Case Problem
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.3k
- Forks
- 367
- Avg merge
- 23h 53m
- Merged PRs (30d)
- 1
Description
Problem:
At the moment we precompute the tests for each switch case and then use the precomputated Variables in each switch case. It would be better to compute the test immediately before making a switch case, however this is not possible because in a Switch block but outside of a switch case there is no javascript context.
Solution Approach:
We could add a SwitchCaseHeader to FuzzIL that opens a javascript context. However this would necessitate changing many files and the payoff for that would only be the ability to correctly compile some very rare and specific cases like the one above. The code above can be used to test if a fix works.
Testbench
A nice illustration for how this problem can manifest can be found here
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked Fuzzilli pull request discussion and the switch-case testbench described in the issue. Then trace how FuzzIL represents and compiles switch blocks and cases. Done means the specific rare case can compute its test immediately before entering the switch case while retaining the required JavaScript context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100