summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-04-16 11:40:16 -0700
committerGitHub <noreply@github.com>2020-04-16 11:40:16 -0700
commit0d5c9dc7b8f704283b2586d88385709326a1c81d (patch)
tree73bb6ae1fc78a5838f5056869fc58967e51e2351
parent5177b9180f978baa94a7297111ac60ec4b0251cc (diff)
downloadbinaryen-0d5c9dc7b8f704283b2586d88385709326a1c81d.tar.gz
binaryen-0d5c9dc7b8f704283b2586d88385709326a1c81d.tar.bz2
binaryen-0d5c9dc7b8f704283b2586d88385709326a1c81d.zip
Validate that tuples have multiple operands (#2768)
This was previously an unwritten and unchecked assumption.
-rw-r--r--src/wasm/wasm-validator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index c152e4b98..1aee9a15d 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -1909,6 +1909,8 @@ void FunctionValidator::visitTupleMake(TupleMake* curr) {
shouldBeTrue(getModule()->features.hasMultivalue(),
curr,
"Tuples are not allowed unless multivalue is enabled");
+ shouldBeTrue(
+ curr->operands.size() > 1, curr, "tuple.make must have multiple operands");
std::vector<Type> types;
for (auto* op : curr->operands) {
if (op->type == Type::unreachable) {