From ed35193eef158d4685a88ed00d742d969d366c64 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 24 Jun 2024 12:17:11 -0700 Subject: Add a proper error for bad select results (#6697) The result cannot be `none` or `unreachable` etc. Fixes #6694 --- src/wasm/wasm-binary.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index dc97dbbc3..b76a789de 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -6865,7 +6865,11 @@ void WasmBinaryReader::visitSelect(Select* curr, uint8_t code) { size_t numTypes = getU32LEB(); std::vector types; for (size_t i = 0; i < numTypes; i++) { - types.push_back(getType()); + auto t = getType(); + if (!t.isConcrete()) { + throwError("bad select type"); + } + types.push_back(t); } curr->type = Type(types); } -- cgit v1.2.3