diff options
author | James Ring <sjr@jdns.org> | 2024-10-08 10:11:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-08 10:11:05 -0700 |
commit | 646785d8b2b15a104d4ed0431125b2c781e141ea (patch) | |
tree | 1e8540bf3b84cb838ef0aaf678c7c0f51e7d8d2a /src/wast-parser.cc | |
parent | e1d84ff0466c269a457056a0420d1b6cc5cf3815 (diff) | |
download | wabt-646785d8b2b15a104d4ed0431125b2c781e141ea.tar.gz wabt-646785d8b2b15a104d4ed0431125b2c781e141ea.tar.bz2 wabt-646785d8b2b15a104d4ed0431125b2c781e141ea.zip |
Raise parse error on NaN in i32 and i64 literals (#2485)
Previously, the parser would return result::Error, but would not
populate an error message.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r-- | src/wast-parser.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index f950512f..c8296461 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2781,7 +2781,8 @@ Result WastParser::ParseConst(Const* const_, ConstType const_type) { case Opcode::I32Const: { auto token = Consume(); if (!token.HasLiteral()) { - return Result::Error; + result = Result::Error; + break; } auto sv = token.literal().text; uint32_t u32; @@ -2793,7 +2794,8 @@ Result WastParser::ParseConst(Const* const_, ConstType const_type) { case Opcode::I64Const: { auto token = Consume(); if (!token.HasLiteral()) { - return Result::Error; + result = Result::Error; + break; } auto sv = token.literal().text; uint64_t u64; |