summaryrefslogtreecommitdiff
path: root/src/ir/lubs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/lubs.cpp')
-rw-r--r--src/ir/lubs.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ir/lubs.cpp b/src/ir/lubs.cpp
index ead1299b5..1f844c244 100644
--- a/src/ir/lubs.cpp
+++ b/src/ir/lubs.cpp
@@ -82,10 +82,15 @@ LUBFinder getResultsLUB(Function* func, Module& wasm) {
for (auto* call : FindAll<CallRef>(func->body).list) {
if (call->isReturn) {
auto targetType = call->target->type;
+ // We can skip unreachable code and calls to bottom types, as both trap.
if (targetType == Type::unreachable) {
continue;
}
- if (!processReturnType(targetType.getHeapType().getSignature().results)) {
+ auto targetHeapType = targetType.getHeapType();
+ if (targetHeapType.isBottom()) {
+ continue;
+ }
+ if (!processReturnType(targetHeapType.getSignature().results)) {
return lub;
}
}