[llvm-cov] Fix a use-after-free
authorVedant Kumar <vsk@apple.com>
Fri, 15 Jul 2016 01:19:36 +0000 (01:19 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 15 Jul 2016 01:19:36 +0000 (01:19 +0000)
commit615b85d9b40627a4cdc37781733ad859c6091f89
tree7cafdf11a7d69bc7b724f509ad9574a9027de173
parent84c452dea35be1515da81a2bec11a178bd001c8d
[llvm-cov] Fix a use-after-free

Taking a lock before appending to a vector does no good unless threads
reading from the vector also take the lock, because the vector could be
re-sized.

I don't have a good isolated test for this. I found the issue with ASan
while testing a large project.  I'm working on a bot that does this.

llvm-svn: 275516
llvm/tools/llvm-cov/CodeCoverage.cpp