From aec412337cdfcde96a1bc663006c481ca5abd98d Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 16 Feb 2012 04:19:15 +0000 Subject: [PATCH] VMCore/AsmWriter.cpp: Use APFloat instead of atof(3). atof(3) might behave differently among platforms. llvm-svn: 150661 --- llvm/lib/VMCore/AsmWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 7bec783b0d31..21d4566a0805 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -733,7 +733,7 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV, ((StrVal[0] == '-' || StrVal[0] == '+') && (StrVal[1] >= '0' && StrVal[1] <= '9'))) { // Reparse stringized version! - if (atof(StrVal.c_str()) == Val) { + if (APFloat(APFloat::IEEEdouble, StrVal).convertToDouble() == Val) { Out << StrVal.str(); return; }