summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-02-02 00:47:46 +0000
committerGitHub <noreply@github.com>2021-02-01 16:47:46 -0800
commita4837c095275b465005841616ff10bcd0b0d7996 (patch)
treefef7ce382071dd9d0aef74ab8b3ee1219367728d /src/wasm-interpreter.h
parenteafb0a4ef25cd82317ac8fa84a9d7e58f9382fcc (diff)
downloadbinaryen-a4837c095275b465005841616ff10bcd0b0d7996.tar.gz
binaryen-a4837c095275b465005841616ff10bcd0b0d7996.tar.bz2
binaryen-a4837c095275b465005841616ff10bcd0b0d7996.zip
[GC] isGCData => isData (#3534)
We added isGCData() before we had dataref. But now there is a clear parallel of Function vs Data. This PR makes us more consistent there, renaming isGCData to isData and using that throughout. This also fixes a bug where the old isGCData just checked if the input was an Array or a Struct, and ignored the data heap type itself. It is not possible to test that, however, due to other bugs, so that is deferred.
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index ac64a30c0..c01b56ec7 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1320,7 +1320,7 @@ public:
case RefIsFunc:
return Literal(!value.isNull() && value.type.isFunction());
case RefIsData:
- return Literal(!value.isNull() && value.isGCData());
+ return Literal(!value.isNull() && value.isData());
case RefIsI31:
return Literal(!value.isNull() &&
value.type.getHeapType() == HeapType::i31);
@@ -1429,7 +1429,7 @@ public:
// anyref of null (already handled above) or anything else (handled here,
// but this is for future use as atm the binaryen interpreter cannot
// represent external references).
- if (!cast.originalRef.isGCData()) {
+ if (!cast.originalRef.isData()) {
cast.outcome = cast.Failure;
return cast;
}
@@ -1509,7 +1509,7 @@ public:
}
break;
case BrOnData:
- if (!value.isGCData()) {
+ if (!value.isData()) {
return {value};
}
break;
@@ -1699,7 +1699,7 @@ public:
}
break;
case RefAsData:
- if (value.isGCData()) {
+ if (value.isData()) {
trap("not a data");
}
break;