mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-23 20:45:06 +00:00
Check whether the iterator p == the end iterator before trying to dereference it. This is a speculative fix for a failure found on the valgrind buildbot triggered by a clang test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217295 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
14b2112e24
commit
05ad06754c
@ -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++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user