mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Don't pass in a null pointer to std::string's ctor, an empty string
ref should produce an empty std::string. This fixes PR7879. llvm-svn: 111332
This commit is contained in:
parent
982a804b20
commit
c27b10f80d
@ -149,7 +149,10 @@ namespace llvm {
|
||||
unsigned edit_distance(StringRef Other, bool AllowReplacements = true);
|
||||
|
||||
/// str - Get the contents as an std::string.
|
||||
std::string str() const { return std::string(Data, Length); }
|
||||
std::string str() const {
|
||||
if (Data == 0) return "";
|
||||
return std::string(Data, Length);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @name Operator Overloads
|
||||
|
Loading…
Reference in New Issue
Block a user