Skip to content

Commit ed35193

Browse files
authored
Add a proper error for bad select results (#6697)
The result cannot be `none` or `unreachable` etc. Fixes #6694
1 parent a27d952 commit ed35193

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6865,7 +6865,11 @@ void WasmBinaryReader::visitSelect(Select* curr, uint8_t code) {
68656865
size_t numTypes = getU32LEB();
68666866
std::vector<Type> types;
68676867
for (size_t i = 0; i < numTypes; i++) {
6868-
types.push_back(getType());
6868+
auto t = getType();
6869+
if (!t.isConcrete()) {
6870+
throwError("bad select type");
6871+
}
6872+
types.push_back(t);
68696873
}
68706874
curr->type = Type(types);
68716875
}

0 commit comments

Comments
 (0)