summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-26 21:09:31 +0000
committerGitHub <noreply@github.com>2021-01-26 13:09:31 -0800
commit5e57a13614c56f959faab675d6bcabbd629ec562 (patch)
tree3c86a2741cffa6da009741506eed4513acc60bf1 /src/wasm/wasm-validator.cpp
parent89164cdf1403a21a3d79ada0f0cf529d526c9de6 (diff)
downloadbinaryen-5e57a13614c56f959faab675d6bcabbd629ec562.tar.gz
binaryen-5e57a13614c56f959faab675d6bcabbd629ec562.tar.bz2
binaryen-5e57a13614c56f959faab675d6bcabbd629ec562.zip
[GC] RefIsNull => RefIs. (#3516)
This internal refactoring prepares us for ref.is_func/data/i31, by renaming the node and adding an "op" field. For now that field must always be "Null" which means it is a ref.is_null. This adjusts the C API to match the new IR shape. The high-level JS API is unchanged.
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 7cddf5a86..8def0e529 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -331,7 +331,7 @@ public:
void visitMemorySize(MemorySize* curr);
void visitMemoryGrow(MemoryGrow* curr);
void visitRefNull(RefNull* curr);
- void visitRefIsNull(RefIsNull* curr);
+ void visitRefIs(RefIs* curr);
void visitRefFunc(RefFunc* curr);
void visitRefEq(RefEq* curr);
void visitTry(Try* curr);
@@ -1981,14 +1981,14 @@ void FunctionValidator::visitRefNull(RefNull* curr) {
curr->type.isNullable(), curr, "ref.null types must be nullable");
}
-void FunctionValidator::visitRefIsNull(RefIsNull* curr) {
+void FunctionValidator::visitRefIs(RefIs* curr) {
shouldBeTrue(getModule()->features.hasReferenceTypes(),
curr,
- "ref.is_null requires reference-types to be enabled");
+ "ref.is_* requires reference-types to be enabled");
shouldBeTrue(curr->value->type == Type::unreachable ||
curr->value->type.isRef(),
curr->value,
- "ref.is_null's argument should be a reference type");
+ "ref.is_*'s argument should be a reference type");
}
void FunctionValidator::visitRefFunc(RefFunc* curr) {