diff options
author | Keith Winstein <keithw@cs.stanford.edu> | 2023-06-07 10:01:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-07 10:01:04 -0700 |
commit | aca6d6f508176bbb0be5dae087e12264d149c9e9 (patch) | |
tree | 87db42be7d207eb94c6cddeea544cfa9e4df7f27 /src | |
parent | e82833182a3362b26a2cbbfce15c279fbadd048c (diff) | |
download | wabt-aca6d6f508176bbb0be5dae087e12264d149c9e9.tar.gz wabt-aca6d6f508176bbb0be5dae087e12264d149c9e9.tar.bz2 wabt-aca6d6f508176bbb0be5dae087e12264d149c9e9.zip |
WastParser::ErrorExpected: ensure there is a token to consume (#2247)
Fixes assertion failure on empty quoted module
Diffstat (limited to 'src')
-rw-r--r-- | src/wast-parser.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index a596f018..11d0d338 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -720,6 +720,7 @@ void WastParser::ErrorUnlessOpcodeEnabled(const Token& token) { Result WastParser::ErrorExpected(const std::vector<std::string>& expected, const char* example) { + GetToken(); Token token = Consume(); std::string expected_str; if (!expected.empty()) { @@ -752,7 +753,6 @@ Result WastParser::ErrorExpected(const std::vector<std::string>& expected, Result WastParser::ErrorIfLpar(const std::vector<std::string>& expected, const char* example) { if (Match(TokenType::Lpar)) { - GetToken(); return ErrorExpected(expected, example); } return Result::Ok; |