summaryrefslogtreecommitdiff
path: root/src/ir/possible-contents.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-11-16 12:09:06 -0800
committerGitHub <noreply@github.com>2022-11-16 12:09:06 -0800
commit3528a593f5a588d1819c6de9645b63361c13bf6b (patch)
tree4e242ba97db33272b5917c2bcc9a10686ebe0625 /src/ir/possible-contents.cpp
parent41a2f9f394c9bb526c7a3184e571360e3813fb50 (diff)
downloadbinaryen-3528a593f5a588d1819c6de9645b63361c13bf6b.tar.gz
binaryen-3528a593f5a588d1819c6de9645b63361c13bf6b.tar.bz2
binaryen-3528a593f5a588d1819c6de9645b63361c13bf6b.zip
[Wasm GC] Fix a GUFA bug on null call_ref targets (#5262)
If the target is a bottom type then it is a heap type but it is not a signature type, and we should treat it as unreachable (and not crash).
Diffstat (limited to 'src/ir/possible-contents.cpp')
-rw-r--r--src/ir/possible-contents.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index 5170d8fa3..0284101ed 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -763,6 +763,12 @@ struct InfoCollector
});
}
template<typename T> void handleIndirectCall(T* curr, HeapType targetType) {
+ // If the heap type is not a signature, which is the case for a bottom type
+ // (null) then nothing can be called.
+ if (!targetType.isSignature()) {
+ assert(targetType.isBottom());
+ return;
+ }
handleCall(
curr,
[&](Index i) {