diff options
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; |