diff options
author | Sam Clegg <sbc@chromium.org> | 2019-11-26 09:45:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-26 09:45:14 -0600 |
commit | f1716357df721cbbaeacfcf8b1e7a12d4cb99459 (patch) | |
tree | f34fc05f9963956db564904c4ebe7abfabb67d05 /src/binary-reader.cc | |
parent | 4386b19e2854e8d5f303bd7236a20092ff77cb9a (diff) | |
download | wabt-f1716357df721cbbaeacfcf8b1e7a12d4cb99459.tar.gz wabt-f1716357df721cbbaeacfcf8b1e7a12d4cb99459.tar.bz2 wabt-f1716357df721cbbaeacfcf8b1e7a12d4cb99459.zip |
reference-types: add support for typed select (#1253)
Diffstat (limited to 'src/binary-reader.cc')
-rw-r--r-- | src/binary-reader.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 146d6516..67161515 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -636,8 +636,22 @@ Result BinaryReader::ReadFunctionBody(Offset end_offset) { CALLBACK0(OnOpcodeBare); break; + case Opcode::SelectT: { + Index count; + CHECK_RESULT(ReadCount(&count, "num result types")); + if (count != 1) { + PrintError("invalid arity in select instrcution: %u", count); + return Result::Error; + } + Type result_type; + CHECK_RESULT(ReadType(&result_type, "select result type")); + CALLBACK(OnSelectExpr, result_type); + CALLBACK0(OnOpcodeBare); + break; + } + case Opcode::Select: - CALLBACK0(OnSelectExpr); + CALLBACK(OnSelectExpr, Type::Any); CALLBACK0(OnOpcodeBare); break; |