forked from OSchip/llvm-project
[CSSPGO] Fix an access violation due to invalided std::vector pointer invalidation.
std::vector pointers can be invalided while growing. Using std::list instead.
This commit is contained in:
parent
a86bbe1e31
commit
dde162d8a5
|
@ -479,7 +479,7 @@ ContextTrieNode *SampleContextTracker::getContextFor(const DILocation *DIL) {
|
|||
|
||||
// Convert real function names to MD5 names, if the input profile is
|
||||
// MD5-based.
|
||||
std::vector<std::string> MD5Names;
|
||||
std::list<std::string> MD5Names;
|
||||
if (FunctionSamples::UseMD5) {
|
||||
for (auto &Location : S) {
|
||||
MD5Names.emplace_back();
|
||||
|
@ -492,7 +492,7 @@ ContextTrieNode *SampleContextTracker::getContextFor(const DILocation *DIL) {
|
|||
int I = S.size();
|
||||
while (--I >= 0 && ContextNode) {
|
||||
LineLocation &CallSite = S[I].first;
|
||||
StringRef &CalleeName = S[I].second;
|
||||
StringRef CalleeName = S[I].second;
|
||||
ContextNode = ContextNode->getChildContext(CallSite, CalleeName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue