Skip to content

Commit e8e81d4

Browse files
apach301nikic
authored andcommitted
Automerge: [DFAJumpThreading] Fix possible null dereference (#157461)
Fixes #157450 --------- Co-authored-by: Nikita Popov <[email protected]>
2 parents 7997a82 + 3119945 commit e8e81d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ struct MainSwitch {
521521

522522
Instruction *SIUse = dyn_cast<Instruction>(SI->user_back());
523523
// The use of the select inst should be either a phi or another select.
524-
if (!SIUse && !(isa<PHINode>(SIUse) || isa<SelectInst>(SIUse)))
524+
if (!SIUse || !(isa<PHINode>(SIUse) || isa<SelectInst>(SIUse)))
525525
return false;
526526

527527
BasicBlock *SIBB = SI->getParent();

0 commit comments

Comments
 (0)