From 3528a593f5a588d1819c6de9645b63361c13bf6b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 16 Nov 2022 12:09:06 -0800 Subject: [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). --- src/ir/possible-contents.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ir/possible-contents.cpp') 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 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) { -- cgit v1.2.3