[PATCH] D15375: Fix PR #25788: parsing of floating-point constants on non-C locales

Antoine Pitrou via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 00:13:33 PST 2016


pitrou updated this revision to Diff 46233.
pitrou added a comment.

Updated against git master.


http://reviews.llvm.org/D15375

Files:
  lib/AsmParser/LLLexer.cpp

Index: lib/AsmParser/LLLexer.cpp
===================================================================
--- lib/AsmParser/LLLexer.cpp
+++ lib/AsmParser/LLLexer.cpp
@@ -941,7 +941,8 @@
     }
   }
 
-  APFloatVal = APFloat(std::atof(TokStart));
+  APFloatVal = APFloat(APFloat::IEEEdouble,
+                       StringRef(TokStart, CurPtr - TokStart));
   return lltok::APFloat;
 }
 
@@ -977,6 +978,7 @@
     }
   }
 
-  APFloatVal = APFloat(std::atof(TokStart));
+  APFloatVal = APFloat(APFloat::IEEEdouble,
+                       StringRef(TokStart, CurPtr - TokStart));
   return lltok::APFloat;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15375.46233.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160128/d8068523/attachment.bin>


More information about the llvm-commits mailing list