summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm/wasm-validator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 52ba36872..b49b4bb0f 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2299,6 +2299,10 @@ void FunctionValidator::visitStructNew(StructNew* curr) {
"struct.new_with_default value type must be defaultable");
}
} else {
+ shouldBeEqual(curr->operands.size(),
+ fields.size(),
+ curr,
+ "struct.new must have the right number of operands");
// All the fields must have the proper type.
for (Index i = 0; i < fields.size(); i++) {
shouldBeSubType(curr->operands[i]->type,