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

Meador Inge via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 13:11:13 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL271574: [ASMParser] Parse FP constants in non-C locales (authored by meadori).

Changed prior to commit:
  http://reviews.llvm.org/D15375?vs=46233&id=59450#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15375

Files:
  llvm/trunk/lib/AsmParser/LLLexer.cpp

Index: llvm/trunk/lib/AsmParser/LLLexer.cpp
===================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp
@@ -958,7 +958,8 @@
     }
   }
 
-  APFloatVal = APFloat(std::atof(TokStart));
+  APFloatVal = APFloat(APFloat::IEEEdouble,
+                       StringRef(TokStart, CurPtr - TokStart));
   return lltok::APFloat;
 }
 
@@ -994,6 +995,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.59450.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160602/c9425ce7/attachment.bin>


More information about the llvm-commits mailing list