[llvm] 8943036 - Fix UAF in ARMConstantIslandPass.

Qinkun Bao via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 29 12:53:20 PDT 2025


Author: Qinkun Bao
Date: 2025-06-29T19:45:38Z
New Revision: 8943036ec37bc7471a675e0bc05069c55cd834e8

URL: https://github.com/llvm/llvm-project/commit/8943036ec37bc7471a675e0bc05069c55cd834e8
DIFF: https://github.com/llvm/llvm-project/commit/8943036ec37bc7471a675e0bc05069c55cd834e8.diff

LOG: Fix UAF in ARMConstantIslandPass.

Revoke the change in https://github.com/llvm/llvm-project/pull/146198

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index d96b47ffd0c6c..ca3dc15ff3ad6 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -476,8 +476,8 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &mf) {
 
     LLVM_DEBUG(dbgs() << "Beginning BR iteration #" << NoBRIters << '\n');
     bool BRChange = false;
-    for (ImmBranch &Br : llvm::make_early_inc_range(ImmBranches))
-      BRChange |= fixupImmediateBr(Br);
+    for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
+      BRChange |= fixupImmediateBr(ImmBranches[i]);
     if (BRChange && ++NoBRIters > 30)
       report_fatal_error("Branch Fix Up pass failed to converge!");
     LLVM_DEBUG(dumpBBs());


        


More information about the llvm-commits mailing list