From e01e7e9db72eeb688ecb774b58416521e320c3fe Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 24 Mar 2020 19:08:26 -0700 Subject: Disallow tuples in MVP (#2707) Previously the multivalue feature enabled tuples in control flow positions, but tuples elsewhere did not require the multivalue feature. However, allowing tuple operations and locals in MVP modules means that all passes and tools need to support tuples, even if it isn't a high priority for them to support multivalue. Allowing tuples in MVP modules doesn't provide much value, so this changes disallows them entirely unless multivalue is enabled. --- src/wasm/wasm-validator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index d81297408..368c01bdc 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1906,6 +1906,9 @@ void FunctionValidator::visitBrOnExn(BrOnExn* curr) { } void FunctionValidator::visitTupleMake(TupleMake* curr) { + shouldBeTrue(getModule()->features.hasMultivalue(), + curr, + "Tuples are not allowed unless multivalue is enabled"); std::vector types; for (auto* op : curr->operands) { if (op->type == Type::unreachable) { @@ -1924,6 +1927,9 @@ void FunctionValidator::visitTupleMake(TupleMake* curr) { } void FunctionValidator::visitTupleExtract(TupleExtract* curr) { + shouldBeTrue(getModule()->features.hasMultivalue(), + curr, + "Tuples are not allowed unless multivalue is enabled"); if (curr->tuple->type == Type::unreachable) { shouldBeTrue( curr->type == Type::unreachable, -- cgit v1.2.3