Conversation
1c2c6af to
bb0dc9c
Compare
bb0dc9c to
3cafe70
Compare
| #define ERROR(...) parser->Error(GetLocation(), __VA_ARGS__) | ||
| #define ERROR(...) \ | ||
| if (parser) \ | ||
| parser->Error(GetLocation(), __VA_ARGS__) |
There was a problem hiding this comment.
With the change in tokenization, ReadReservedChars() now needs to be able to call GetStringToken() if it sees a " character, but GetStringToken takes a WastParser named parser so it can call the ERROR macro, and ReadReservedChars() is called in a whole bunch of places and takes no arguments. So... this makes it possible for ReadReservedChars() to call GetStringToken(nullptr) without causing a crash if that wants to log an error.
There was a problem hiding this comment.
But won't this mean that such errors can/will be lost?
There was a problem hiding this comment.
Yes, now that strings can be part of a reserved token, we would lose the log message if an invalid string is found while running NoTrailingReservedChars(). I think the best/cleanest fix for this is #2013, which just makes the WastLexer work similar to a WastParser (it receives an Errors* on construction and stores it so it can log errors from any context).
…ly#2001) * Update testsuite (adding new tokens.txt test) * Adjust Wast lexing to match updated spec (WebAssembly/spec#1499)
This had been crashing even with annotations disabled. Adds a regression test. This was missed in #2001 when updating the parser to match the updated spec (WebAssembly/spec#1499). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53935
This had been crashing even with annotations disabled. Adds a regression test. This was missed in #2001 when updating the parser to match the updated spec (WebAssembly/spec#1499). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53935
This had been crashing even with annotations disabled. Adds a regression test. This was missed in #2001 when updating the lexer to match the updated spec (WebAssembly/spec#1499). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53935
The testsuite was already updated in #2003, so this just runs
update-spec-tests.pyto bring in the newtokens.wasttest. The Wast lexer changes are necessary because of WebAssembly/spec#1499 . There may be a more elegant way to make this change, though...