summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-08-17 22:51:27 -0700
committerGitHub <noreply@github.com>2022-08-17 22:51:27 -0700
commit2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9 (patch)
treeec852da20ed85c7e5f9be7a5e3fb0632d7caf949 /src/wasm/wasm-validator.cpp
parent3aff4c6e85623c970280219c6699a66bc9de5f9b (diff)
downloadbinaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.tar.gz
binaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.tar.bz2
binaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.zip
Restore the `extern` heap type (#4898)
The GC proposal has split `any` and `extern` back into two separate types, so reintroduce `HeapType::ext` to represent `extern`. Before it was originally removed in #4633, externref was a subtype of anyref, but now it is not. Now that we have separate heaptype type hierarchies, make `HeapType::getLeastUpperBound` fallible as well.
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 92f6c76bf..e837c2dd6 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -3099,7 +3099,7 @@ static void validateTables(Module& module, ValidationInfo& info) {
}
}
- Type anyref = Type(HeapType::any, Nullable);
+ Type externref = Type(HeapType::ext, Nullable);
Type funcref = Type(HeapType::func, Nullable);
for (auto& table : module.tables) {
info.shouldBeTrue(table->initial <= table->max,
@@ -3110,15 +3110,15 @@ static void validateTables(Module& module, ValidationInfo& info) {
"table",
"Non-nullable reference types are not yet supported for tables");
if (!module.features.hasGC()) {
- info.shouldBeTrue(table->type.isFunction() || table->type == anyref,
+ info.shouldBeTrue(table->type.isFunction() || table->type == externref,
"table",
"Only function reference types or externref are valid "
"for table type (when GC is disabled)");
}
if (!module.features.hasTypedFunctionReferences()) {
- info.shouldBeTrue(table->type == funcref || table->type == anyref,
+ info.shouldBeTrue(table->type == funcref || table->type == externref,
"table",
- "Only funcref and anyref are valid for table type "
+ "Only funcref and externref are valid for table type "
"(when typed-function references are disabled)");
}
}