Enea Zaffanella
2009-Aug-20 14:42 UTC
[LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
Hello. When running clang in Debug mode, I am getting an assertion failure when parsing the following line: float ko = 0x1.1p0; Apparently, the recent changes in the use of StringRef haven't been propagated to all places. Please find attached the trivial patch. Cheers, Enea Zaffanella. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: APFloat.patch URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090820/6dde5d03/attachment.ksh>
Misha Brukman
2009-Aug-20 15:49 UTC
[LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
On Thu, Aug 20, 2009 at 10:42 AM, Enea Zaffanella <zaffanella at cs.unipr.it>wrote:> When running clang in Debug mode, I am getting an assertion failure when > parsing the following line: > > float ko = 0x1.1p0; > > Apparently, the recent changes in the use of StringRef haven't been > propagated to all places. Please find attached the trivial patch.Can you please also add a test to unittests/ADT/APFloatTest.cpp to validate this, i.e., a test that would fail before this patch but passes with this patch. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090820/016062d4/attachment.html>
Daniel Dunbar
2009-Aug-20 17:13 UTC
[LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
Fixed in r79450, along with an additional one of the same nature. Thanks, - Daniel On Thu, Aug 20, 2009 at 7:42 AM, Enea Zaffanella<zaffanella at cs.unipr.it> wrote:> Hello. > > When running clang in Debug mode, I am getting an assertion failure when > parsing the following line: > > float ko = 0x1.1p0; > > Apparently, the recent changes in the use of StringRef haven't been > propagated to all places. Please find attached the trivial patch. > > Cheers, > Enea Zaffanella. > > > Index: lib/Support/APFloat.cpp > ==================================================================> --- lib/Support/APFloat.cpp (revision 79510) > +++ lib/Support/APFloat.cpp (working copy) > @@ -2153,7 +2153,7 @@ > integerPart hex_value; > > if(*p == '.') { > - assert(dot == 0); > + assert(dot == s.end()); > dot = p++; > } > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Erick Tryzelaar
2009-Aug-20 17:51 UTC
[LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
On Thu, Aug 20, 2009 at 10:13 AM, Daniel Dunbar<daniel at zuster.org> wrote:> Fixed in r79450, along with an additional one of the same nature. > > Thanks, > - DanielThanks Daniel and Enea for finding this! I'm adding a lot more test cases like this to APFloat's unittests so hopefully we won't have any other bugs lying around.
Possibly Parallel Threads
- [LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
- [LLVMdev] Buggy assertion in APFloat::convertFromHexadecimalString
- Incorrect return values for APFloat::convertFromString?
- [LLVMdev] error api for APInt / APFloat
- [LLVMdev] buildbot failure in LLVM on clang-amd64-openbsd