[polly] r235254 - Clear InsnToMemAcc map in ScopDetection after each runOnFunction

Tobias Grosser tobias at grosser.es
Sat Apr 18 04:01:26 PDT 2015


Author: grosser
Date: Sat Apr 18 06:01:25 2015
New Revision: 235254

URL: http://llvm.org/viewvc/llvm-project?rev=235254&view=rev
Log:
Clear InsnToMemAcc map in ScopDetection after each runOnFunction

Otherwise, instructions in different functions that share the same pointer (due
to earlier modifications), might get assigned incorrect memory access
information (belonging to instructions in previous functions), which can result
in arbitrary memory corruption and assertion failures.

This fixes llvm.org/PR23160 and possibly also llvm.org/PR23167.

Note: InsnToMemAcc is a global variable that should never have existed in the
first place. We will clean this up in a subsequent patch.

Reported-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Debugged-by: Johannes Doerfert <doerfert at cs.uni-saarland.de>

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=235254&r1=235253&r2=235254&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sat Apr 18 06:01:25 2015
@@ -1084,6 +1084,7 @@ void ScopDetection::releaseMemory() {
   ValidRegions.clear();
   RejectLogs.clear();
   NonAffineSubRegionMap.clear();
+  InsnToMemAcc.clear();
 
   // Do not clear the invalid function set.
 }





More information about the llvm-commits mailing list