Skip to content

Commit 631bee4

Browse files
committed
BasicCalleeAnalysis: don't crash if the bca argument to isDeinitBarrier is null
Some clients don't provide a callee analysis to this API. Don't crash in this case.
1 parent 248c026 commit 631bee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ getMemoryBehavior(FullApplySite as, bool observeRetains) {
7575

7676
bool swift::isDeinitBarrier(SILInstruction *const instruction,
7777
BasicCalleeAnalysis *bca) {
78-
if (!instructionIsDeinitBarrierFunction) {
78+
if (!instructionIsDeinitBarrierFunction || !bca) {
7979
return mayBeDeinitBarrierNotConsideringSideEffects(instruction);
8080
}
8181
BridgedInstruction inst = {

0 commit comments

Comments
 (0)