projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ca4a6b
)
Fix iterator-invalidation issue
author
Hal Finkel
<hfinkel@anl.gov>
Thu, 15 Dec 2016 03:30:40 +0000
(
03:30
+0000)
committer
Hal Finkel
<hfinkel@anl.gov>
Thu, 15 Dec 2016 03:30:40 +0000
(
03:30
+0000)
Inserting a new key into a DenseMap potentially invalidates iterators into that
map. Trying to fix an issue from r289755 triggering this assertion:
Assertion `isHandleInSync() && "invalid iterator access!"' failed.
llvm-svn: 289757
llvm/lib/Analysis/ScalarEvolution.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Analysis/ScalarEvolution.cpp
b/llvm/lib/Analysis/ScalarEvolution.cpp
index
7939c9e
..
3a99f2a
100644
(file)
--- a/
llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/
llvm/lib/Analysis/ScalarEvolution.cpp
@@
-3529,7
+3529,9
@@
void ScalarEvolution::addAffectedFromOperands(const SCEV *S) {
if (AMI == AffectedMap.end())
continue;
- AffectedMap[S].insert(AMI->second.begin(), AMI->second.end());
+ auto &ISet = AffectedMap[S];
+ AMI = AffectedMap.find(Op);
+ ISet.insert(AMI->second.begin(), AMI->second.end());
}
}