mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix crash in CString's 'debugDescription' when the underlying pointer is null.
Fixes <rdar://problem/16227050> Swift SVN r18202
This commit is contained in:
@@ -68,6 +68,9 @@ struct CString :
|
||||
|
||||
extension CString : DebugPrintable {
|
||||
var debugDescription: String {
|
||||
if isNull() {
|
||||
return "<null C string>"
|
||||
}
|
||||
return String.fromCString(self).debugDescription
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user