[llvm] [llvm] Fix possible null dereference in Transforms/Scalar (PR #157461)

Daniel Kuts via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 06:34:46 PDT 2025


================
@@ -521,7 +521,7 @@ struct MainSwitch {
 
     Instruction *SIUse = dyn_cast<Instruction>(SI->user_back());
     // The use of the select inst should be either a phi or another select.
-    if (!SIUse && !(isa<PHINode>(SIUse) || isa<SelectInst>(SIUse)))
+    if (SIUse && !(isa<PHINode>(SIUse) || isa<SelectInst>(SIUse)))
----------------
apach301 wrote:

Seems so

https://github.com/llvm/llvm-project/pull/157461


More information about the llvm-commits mailing list