projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
116cc72
)
Fix a latent UAF bug in profwriter
author
Xinliang David Li
<davidxl@google.com>
Sun, 20 Dec 2015 08:46:18 +0000
(08:46 +0000)
committer
Xinliang David Li
<davidxl@google.com>
Sun, 20 Dec 2015 08:46:18 +0000
(08:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256116
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/ProfileData/InstrProfWriter.cpp
patch
|
blob
|
history
diff --git
a/lib/ProfileData/InstrProfWriter.cpp
b/lib/ProfileData/InstrProfWriter.cpp
index 1e18c268892c0dcc3b2af2836db07ae47d281171..9bb03e1e77a38deda428e062385d465410028011 100644
(file)
--- a/
lib/ProfileData/InstrProfWriter.cpp
+++ b/
lib/ProfileData/InstrProfWriter.cpp
@@
-108,6
+108,8
@@
std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I,
if (NewFunc) {
// We've never seen a function with this name and hash, add it.
Dest = std::move(I);
+ // Fix up the name to avoid dangling reference.
+ Dest.Name = FunctionData.find(Dest.Name)->getKey();
Result = instrprof_error::success;
if (Weight > 1) {
for (auto &Count : Dest.Counts) {