diff options
author | daxpedda <daxpedda@gmail.com> | 2024-10-31 19:59:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 18:59:39 +0000 |
commit | e32b76d6325f0997fabef20cc546526075db09a4 (patch) | |
tree | afb9ebb965c00808a1e2463dd46aec3e9f241033 | |
parent | 73279d36fe08e867ca3d9adb85d53b4c67dd16d6 (diff) | |
download | binaryen-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.cpp | 6 |
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, |