]> granicus.if.org Git - llvm/commit
[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)
commit343b2711ecbe862c86f5a410e2b57c904f7bf9ce
treecd3bed3f3ad6d9d8d5ddc6f3bc9711bf8c3f278f
parentb9d9ab2c3263130e85ff1f322134358fb885c90b
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275516 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-cov/CodeCoverage.cpp