forked from OSchip/llvm-project
Don't iterate endlessly if an error occurs.
llvm-svn: 271048
This commit is contained in:
parent
2bd4f8b66b
commit
0364f67f61
|
@ -93,12 +93,13 @@ public:
|
|||
if (!Array || IterRef.getLength() == 0 || ThisLen == 0)
|
||||
return *this;
|
||||
IterRef = IterRef.drop_front(ThisLen);
|
||||
if (IterRef.getLength() == 0) {
|
||||
Array = nullptr;
|
||||
if (IterRef.getLength() == 0)
|
||||
ThisLen = 0;
|
||||
} else {
|
||||
else
|
||||
// TODO: We should report an error if Extract fails.
|
||||
ThisLen = Extract(IterRef, ThisValue);
|
||||
}
|
||||
if (ThisLen == 0)
|
||||
Array = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue