fuzzilli icon indicating copy to clipboard operation
fuzzilli copied to clipboard

Unhandled node type SwitchStatement

Open nth10sd opened this issue 2 years ago • 1 comments

node parser.js ../../Protobuf/ast.proto code.js output.ast.proto

code.js:

switch (x) {};

Switch statements do not yet seem to be supported on rev d386a838.

<repo>/Sources/Fuzzilli/Compiler/Parser/parser.js:324
                throw "Unhandled node type " + node.type;
                ^
Unhandled node type SwitchStatement
Thrown at:
    at visitStatement (<repo>/Sources/Fuzzilli/Compiler/Parser/parser.js:324:17)
    at visitProgram (<repo>/Sources/Fuzzilli/Compiler/Parser/parser.js:51:37)
    at parse (<repo>/Sources/Fuzzilli/Compiler/Parser/parser.js:561:12)
    at <repo>/Sources/Fuzzilli/Compiler/Parser/parser.js:570:15
    at finish (<repo>/Sources/Fuzzilli/Compiler/Parser/node_modules/protobufjs/src/root.js:105:9)
    at process (<repo>/Sources/Fuzzilli/Compiler/Parser/node_modules/protobufjs/src/root.js:143:13)
    at <repo>/Sources/Fuzzilli/Compiler/Parser/node_modules/protobufjs/src/root.js:195:17
    at fetchReadFileCallback (<repo>/Sources/Fuzzilli/Compiler/Parser/node_modules/@protobufjs/fetch/index.js:51:19)
    at readFileAfterClose (node:internal/fs/read/context:68:3)

nth10sd avatar Jan 17 '24 01:01 nth10sd

Similar to issue #410, the parser/compiler isn't feature complete (but PRs welcome!). This is probably a little more work to implement than the ternary operator, but should also be possible as the IL should fully support switch statements.

saelo avatar Jan 18 '24 20:01 saelo