Skip to content

Commit 4994a9d

Browse files
Small fix to graph building
We don't need to walk up the supertype chain for type targets of indirect calls, we already do that for function implementations which would reach the type of the indirect call anyway
1 parent 0890c8f commit 4994a9d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/passes/GlobalEffects.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,14 @@ CallGraph buildCallGraph(const Module& module,
161161
if (!closedWorld) {
162162
continue;
163163
}
164-
165164
// Function -> Type
166165
allFunctionTypes.insert(caller->type.getHeapType());
167166
for (HeapType calleeType : callerInfo.indirectCalledTypes) {
168167
callees.insert(calleeType);
169-
allFunctionTypes.insert(calleeType);
168+
169+
// Add the key to ensure the lookup doesn't fail for indirect calls to
170+
// uninhabited types.
171+
callGraph[calleeType];
170172
}
171173

172174
// Type -> Function

0 commit comments

Comments
 (0)