summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-04-11 13:55:56 +0000
committerDiego Novillo <dnovillo@google.com>2014-04-11 13:55:56 +0000
commitbb7b423bdc5cf85f4b68afdd8665e4848d2845d1 (patch)
tree0dde01327b930cc11b9d2d18e9bd8c5a830ffe52 /lib/IR
parenteb0c9094acd5f5a28c0adafb1784797d1d7a4e2d (diff)
downloadllvm-bb7b423bdc5cf85f4b68afdd8665e4848d2845d1.tar.gz
llvm-bb7b423bdc5cf85f4b68afdd8665e4848d2845d1.tar.bz2
llvm-bb7b423bdc5cf85f4b68afdd8665e4848d2845d1.tar.xz
Fix use-after-free bug caught by address sanitizer:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2959 The location string is returned as a std::string, not a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/DiagnosticInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/DiagnosticInfo.cpp b/lib/IR/DiagnosticInfo.cpp
index 82cc0ed47b..3f8100f985 100644
--- a/lib/IR/DiagnosticInfo.cpp
+++ b/lib/IR/DiagnosticInfo.cpp
@@ -80,7 +80,7 @@ void DiagnosticInfoOptimizationRemark::getLocation(StringRef *Filename,
*Column = DIL.getColumnNumber();
}
-const StringRef DiagnosticInfoOptimizationRemark::getLocationStr() const {
+const std::string DiagnosticInfoOptimizationRemark::getLocationStr() const {
StringRef Filename("<unknown>");
unsigned Line = 0;
unsigned Column = 0;