mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-26 22:45:05 +00:00
Create empty StringRef is incoming cstring is NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a0b6e6ded
commit
1e9a727f10
@ -46,7 +46,7 @@ namespace llvm {
|
||||
|
||||
/// Construct a string ref from a cstring.
|
||||
/*implicit*/ StringRef(const char *Str)
|
||||
: Data(Str), Length(::strlen(Str)) {}
|
||||
: Data(Str) { if (Str) Length = ::strlen(Str); else Length = 0; }
|
||||
|
||||
/// Construct a string ref from a pointer and length.
|
||||
/*implicit*/ StringRef(const char *_Data, unsigned _Length)
|
||||
|
Loading…
x
Reference in New Issue
Block a user