don't form an std::string with a null pointer, it aborts.
authorChris Lattner <sabre@nondot.org>
Fri, 18 Jan 2008 18:54:31 +0000 (18:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Jan 2008 18:54:31 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46166 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringExtras.h

index 20ba92a4aeb1a82092254546630c6d68fecea1f2..2a01c5f2d34e4f4c1ebad931dbb0ec0e723d78a1 100644 (file)
@@ -98,7 +98,7 @@ static inline std::string ftostr(const APFloat& V) {
     return ftostr(V.convertToDouble());
   else if (&V.getSemantics() == &APFloat::IEEEsingle)
     return ftostr((double)V.convertToFloat());
-  return 0; // error
+  return "<unknown format in ftostr>"; // error
 }
 
 static inline std::string LowercaseString(const std::string &S) {