diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-17 22:07:51 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-17 22:07:51 +0000 |
commit | 5049ee5b11fe55e5a553b5388406aab874717672 (patch) | |
tree | 6261142b70a9c2000858a73d350a2cada04a9708 /include/llvm/ADT/IntervalMap.h | |
parent | 175fb36f101a20df10db90bfe4d0c44a7d05325b (diff) | |
download | external_llvm-5049ee5b11fe55e5a553b5388406aab874717672.zip external_llvm-5049ee5b11fe55e5a553b5388406aab874717672.tar.gz external_llvm-5049ee5b11fe55e5a553b5388406aab874717672.tar.bz2 |
It is allowed to call IntervalMap::const_iterator::advanceTo() with a key that
moves the iterator to end(), and it is valid to call it on end().
That means it is valid to call advanceTo() with any monotonic key sequence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/IntervalMap.h')
-rw-r--r-- | include/llvm/ADT/IntervalMap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/ADT/IntervalMap.h b/include/llvm/ADT/IntervalMap.h index 25be574..c13846d 100644 --- a/include/llvm/ADT/IntervalMap.h +++ b/include/llvm/ADT/IntervalMap.h @@ -1411,6 +1411,8 @@ public: /// The search is started from the current position, and no earlier positions /// can be found. This is much faster than find() for small moves. void advanceTo(KeyT x) { + if (!valid()) + return; if (branched()) treeAdvanceTo(x); else |