Fix use-after-free with profile remapping.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 19 Dec 2018 03:24:03 +0000 (03:24 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 19 Dec 2018 03:24:03 +0000 (03:24 +0000)
commit0b832095d7c383e464e51db0a7c86f9e553926ca
treed6d0c0cfd94f184d693283c84a99729ca512ded6
parenta6247e7cf426431e869e947532ba3f0fb9f6e8fc
Fix use-after-free with profile remapping.

We need to keep the underlying profile reader alive as long as the
profile data, because the profile data may contain StringRefs referring
to strings in the reader's name table.

llvm-svn: 349600
llvm/include/llvm/ProfileData/SampleProfReader.h
llvm/unittests/ProfileData/SampleProfTest.cpp