summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaxpedda <daxpedda@gmail.com>2024-10-31 19:59:39 +0100
committerGitHub <noreply@github.com>2024-10-31 18:59:39 +0000
commite32b76d6325f0997fabef20cc546526075db09a4 (patch)
treeafb9ebb965c00808a1e2463dd46aec3e9f241033
parent73279d36fe08e867ca3d9adb85d53b4c67dd16d6 (diff)
downloadbinaryen-e32b76d6325f0997fabef20cc546526075db09a4.tar.gz
binaryen-e32b76d6325f0997fabef20cc546526075db09a4.tar.bz2
binaryen-e32b76d6325f0997fabef20cc546526075db09a4.zip
Require reference-types in addition to bulk-memory for table.fill (#7040)
table.fill was introduced by the reference-types proposal (but also, only makes sense among the other bulk memory operations, so require both).
-rw-r--r--src/wasm/wasm-validator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index d1ca5220c..5867c04a0 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2454,9 +2454,11 @@ void FunctionValidator::visitTableGrow(TableGrow* curr) {
}
void FunctionValidator::visitTableFill(TableFill* curr) {
- shouldBeTrue(getModule()->features.hasBulkMemory(),
+ shouldBeTrue(getModule()->features.hasBulkMemory() &&
+ getModule()->features.hasReferenceTypes(),
curr,
- "table.fill requires bulk-memory [--enable-bulk-memory]");
+ "table.fill requires bulk-memory [--enable-bulk-memory] and "
+ "reference-types [--enable-reference-types]");
auto* table = getModule()->getTableOrNull(curr->table);
if (shouldBeTrue(!!table, curr, "table.fill table must exist")) {
shouldBeSubType(curr->value->type,