projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14b2112
)
Check whether the iterator p == the end iterator before trying to dereference it...
author
Nick Lewycky
<nicholas@mxc.ca>
Sat, 6 Sep 2014 01:16:42 +0000
(
01:16
+0000)
committer
Nick Lewycky
<nicholas@mxc.ca>
Sat, 6 Sep 2014 01:16:42 +0000
(
01:16
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217295
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/APFloat.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/APFloat.cpp
b/lib/Support/APFloat.cpp
index 097986d3e7ccd118850e82775cd598ea824931c2..659914a85f568a349f2328b2a1930952c572d59f 100644
(file)
--- a/
lib/Support/APFloat.cpp
+++ b/
lib/Support/APFloat.cpp
@@
-212,15
+212,15
@@
skipLeadingZeroesAndAnyDot(StringRef::iterator begin, StringRef::iterator end,
{
StringRef::iterator p = begin;
*dot = end;
- while (
*p == '0' && p != end
)
+ while (
p != end && *p == '0'
)
p++;
- if (*p == '.') {
+ if (
p != end &&
*p == '.') {
*dot = p++;
assert(end - begin != 1 && "Significand has no digits");
- while (
*p == '0' && p != end
)
+ while (
p != end && *p == '0'
)
p++;
}