Clear InsnToMemAcc map in ScopDetection after each runOnFunction
authorTobias Grosser <tobias@grosser.es>
Sat, 18 Apr 2015 11:01:25 +0000 (11:01 +0000)
committerTobias Grosser <tobias@grosser.es>
Sat, 18 Apr 2015 11:01:25 +0000 (11:01 +0000)
commit4b6aa6eb8efe45474f7eae211c1d64e2eff00e6e
tree97bd72945a684ed2e670d32d345f7d125ea921c4
parent5df7c1a4eb5fe06295ddfc7c4638017ac2c01d87
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@apple.com>
Debugged-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 235254
polly/lib/Analysis/ScopDetection.cpp