webassemblyjs
webassemblyjs copied to clipboard
Bug: cannot read property 'charCodeAt' of undefined
Hey,
Found the following bug that can be reproduced with:
const wast = require("@webassemblyjs/wast-parser");
wast.parse('"\u0019g ')
Thrown:
TypeError: Cannot read property 'charCodeAt' of undefined
at isNewLine (/Users/yevgenyp/fuzzitdev/jsfuzz/node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js:33:15)
at tokenize (/Users/yevgenyp/fuzzitdev/jsfuzz/node_modules/@webassemblyjs/wast-parser/lib/tokenizer.js:347:13)
at Object.parse (/Users/yevgenyp/fuzzitdev/jsfuzz/node_modules/@webassemblyjs/wast-parser/lib/index.js:31:40)
Found using jsfuzz
Would you mind sending a PR?
hey @xtuc !:) I'm not sure I'll have time in the near future but I suggest marking this as bug/help wanted and maybe someone will be able to contribute the PR before me.