summaryrefslogtreecommitdiff
path: root/src/tools/wasm-ctor-eval.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-ctor-eval.cpp')
-rw-r--r--src/tools/wasm-ctor-eval.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index 6c72f1c73..9cf552450 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -834,11 +834,13 @@ public:
// logic here, we save the original (possible externalized) value, and then
// look at the internals from here on out.
Literal original = value;
- if (value.type.isRef() && value.type.getHeapType() == HeapType::ext) {
+ if (value.type.isRef() &&
+ value.type.getHeapType().isMaybeShared(HeapType::ext)) {
value = value.internalize();
// We cannot serialize truly external things, only data and i31s.
- assert(value.isData() || value.type.getHeapType() == HeapType::i31);
+ assert(value.isData() ||
+ value.type.getHeapType().isMaybeShared(HeapType::i31));
}
// GC data (structs and arrays) must be handled with the special global-
@@ -920,7 +922,7 @@ public:
Expression* ret = builder.makeGlobalGet(definingGlobalName, value.type);
if (original != value) {
// The original is externalized.
- assert(original.type.getHeapType() == HeapType::ext);
+ assert(original.type.getHeapType().isMaybeShared(HeapType::ext));
ret = builder.makeRefAs(ExternConvertAny, ret);
}
return ret;