mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 04:22:57 +02:00
StringRef(const char*) should not be used to turn null pointers into empty
strings. llvm-svn: 87031
This commit is contained in:
parent
7c84128066
commit
880dfd38d8
@ -46,7 +46,7 @@ namespace llvm {
|
||||
|
||||
/// Construct a string ref from a cstring.
|
||||
/*implicit*/ StringRef(const char *Str)
|
||||
: Data(Str) { if (Str) Length = ::strlen(Str); else Length = 0; }
|
||||
: Data(Str), Length(::strlen(Str)) {}
|
||||
|
||||
/// Construct a string ref from a pointer and length.
|
||||
/*implicit*/ StringRef(const char *data, size_t length)
|
||||
|
Loading…
Reference in New Issue
Block a user