From 0d5c9dc7b8f704283b2586d88385709326a1c81d Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 16 Apr 2020 11:40:16 -0700 Subject: Validate that tuples have multiple operands (#2768) This was previously an unwritten and unchecked assumption. --- src/wasm/wasm-validator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wasm/wasm-validator.cpp') 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 types; for (auto* op : curr->operands) { if (op->type == Type::unreachable) { -- cgit v1.2.3