mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
StringRef(const char*) should not be used to turn null pointers into empty
strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6bedb30220
commit
89fccca4b0
@ -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