[llvm-branch-commits] [llvm-branch] r117804 - /llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp

Daniel Dunbar daniel at zuster.org
Sat Oct 30 10:20:29 PDT 2010


Author: ddunbar
Date: Sat Oct 30 12:20:29 2010
New Revision: 117804

URL: http://llvm.org/viewvc/llvm-project?rev=117804&view=rev
Log:
Merge r117698:
--
Author: Dan Gohman <gohman at apple.com>
Date:   Fri Oct 29 20:16:10 2010 +0000

    Make ScalarEvolution::forgetLoop forget all contained loops too, because
    they may have ValuesAtScopes map entries referencing their outer loops.
    This fixes a user-after-free reported in PR8471.

Modified:
    llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp?rev=117804&r1=117803&r2=117804&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Analysis/ScalarEvolution.cpp Sat Oct 30 12:20:29 2010
@@ -3781,6 +3781,11 @@
 
     PushDefUseChildren(I, Worklist);
   }
+
+  // Forget all contained loops too, to avoid dangling entries in the
+  // ValuesAtScopes map.
+  for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
+    forgetLoop(*I);
 }
 
 /// forgetValue - This method should be called by the client when it has





More information about the llvm-branch-commits mailing list