diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-02-19 03:18:29 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-02-19 03:18:29 +0000 |
commit | 752b2f0d8815c65ed2ca3d8428e8060644562e24 (patch) | |
tree | 5bf747936aec0d68cbf8e537d9385ae83849b760 /lib/Support/APFloat.cpp | |
parent | ac027144e8e22563c9bb057598c710aac57c072f (diff) |
APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r-- | lib/Support/APFloat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 8913dd6def..525aea28c6 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -3340,7 +3340,7 @@ namespace { // 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; |