[llvm-commits] [llvm] r150911 - /llvm/trunk/lib/Support/APFloat.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Sat Feb 18 19:18:29 PST 2012
Author: chapuni
Date: Sat Feb 18 21:18:29 2012
New Revision: 150911
URL: http://llvm.org/viewvc/llvm-project?rev=150911&view=rev
Log:
APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.
Modified:
llvm/trunk/lib/Support/APFloat.cpp
Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=150911&r1=150910&r2=150911&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Sat Feb 18 21:18:29 2012
@@ -3340,7 +3340,7 @@
// Rounding down is just a truncation, except we also want to drop
// trailing zeros from the new result.
if (buffer[FirstSignificant - 1] < '5') {
- while (buffer[FirstSignificant] == '0')
+ while (FirstSignificant < N && buffer[FirstSignificant] == '0')
FirstSignificant++;
exp += FirstSignificant;
More information about the llvm-commits
mailing list