Skip to content

Commit 5076e7b

Browse files
committed
[AddressLowering] NFC: Moved assert above NPE.
Moved the assert that the value which opens an archetype exists before the call to get its defining instruction which would be an NPE if the value were in fact null.
1 parent a23bcef commit 5076e7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,8 +1360,8 @@ SILInstruction *AddressLoweringState::getLatestOpeningInst(SILType ty) const {
13601360
auto openingVal =
13611361
getModule()->getRootLocalArchetypeDef(openedTy, function);
13621362

1363-
auto *openingInst = openingVal->getDefiningInstruction();
13641363
assert(openingVal && "all opened archetypes should be resolved");
1364+
auto *openingInst = openingVal->getDefiningInstruction();
13651365
if (latestOpeningInst) {
13661366
if (domInfo->dominates(openingInst, latestOpeningInst))
13671367
return;

0 commit comments

Comments
 (0)