Skip to content

Commit 3119945

Browse files
apach301nikic
andauthored
[DFAJumpThreading] Fix possible null dereference (#157461)
Fixes #157450 --------- Co-authored-by: Nikita Popov <[email protected]>
1 parent 49f1751 commit 3119945

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)