forked from OSchip/llvm-project
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. llvm-svn: 206032
This commit is contained in:
parent
77d8793fa6
commit
199de39bf0
|
@ -267,7 +267,7 @@ public:
|
|||
/// Return a string with the location information for this diagnostic
|
||||
/// in the format "file:line:col". If location information is not available,
|
||||
/// it returns "<unknown>:0:0".
|
||||
const StringRef getLocationStr() const;
|
||||
const std::string getLocationStr() const;
|
||||
|
||||
/// Return location information for this diagnostic in three parts:
|
||||
/// the source file name, line number and column.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue