From 8ece4546102de10e9717cf8174ab2064d595e7d1 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Fri, 29 May 2020 12:46:53 -0700 Subject: [wasm2wat] Write select type immediate (#1451) The main fix is in `wat-writer.cc`, where the type immediate was never being printed. But I've also included a change to how `select` type immediates are represented in wabt. Previously, a bare `select` instruction would be stored with the type `Type::Any`. This is not a real wasm type, and is primarily used for type validation. The spec instead considers this form of `select` to have an empty type immediate, which is closer to the `Type::Void` type. This commit now uses `Type::Void` (or an empty `TypeVector`) to represent the bare `select` instruction. Fixes #1444. --- test/spec/reference-types/select.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/spec') diff --git a/test/spec/reference-types/select.txt b/test/spec/reference-types/select.txt index ceb244ca..04973ee2 100644 --- a/test/spec/reference-types/select.txt +++ b/test/spec/reference-types/select.txt @@ -12,7 +12,8 @@ out/test/spec/reference-types/select.wast:342: assert_invalid passed: error: type mismatch in select, expected [any, any, i32] but got [i32] 000001c: error: OnSelectExpr callback failed out/test/spec/reference-types/select.wast:346: assert_invalid passed: - 000001d: error: invalid arity in select instrcution: 0 + error: type mismatch in select, expected [any, any, i32] but got [i32] + 000001c: error: OnSelectExpr callback failed out/test/spec/reference-types/select.wast:350: assert_invalid passed: 0000025: error: invalid arity in select instrcution: 2 out/test/spec/reference-types/select.wast:362: assert_invalid passed: -- cgit v1.2.3