summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2017-02-20 18:33:40 +0000
committerSteven Wu <stevenwu@apple.com>2017-02-20 18:33:40 +0000
commitabfea288671bdad695d80f8e055ae6cc4d3b093c (patch)
treedd6f6a59484d56be69ba1af82f6b0599517cbf0c /llvm
parent51c0128310776a21dc5650d84f2a2f9a9ea62675 (diff)
downloadbcm5719-llvm-abfea288671bdad695d80f8e055ae6cc4d3b093c.tar.gz
bcm5719-llvm-abfea288671bdad695d80f8e055ae6cc4d3b093c.zip
Fix use-after-free found by ASAN
DenseMap::lookup returns copy of the value in the map. Returning the address of the temporary return value will cause use-after-free. llvm-svn: 295675
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/DebugCounter.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index 46138914d0c..ee56ecf39ca 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -111,7 +111,7 @@ public:
unsigned int getNumCounters() const { return RegisteredCounters.size(); }
// Return the name and description of the counter with the given ID.
- std::pair<StringRef, StringRef> getCounterInfo(unsigned ID) const {
+ std::pair<std::string, std::string> getCounterInfo(unsigned ID) const {
return std::make_pair(RegisteredCounters[ID], CounterDesc.lookup(ID));
}
OpenPOWER on IntegriCloud