diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-17 19:18:38 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-17 19:18:38 +0000 |
commit | 4aec85ae01188f87e45e5e91baab4f303cbcd336 (patch) | |
tree | 70c1d2c1852f26f6476fd10f789c98122988de6f /unittests/ADT | |
parent | a3dbd3a2444f2531763ba05b64a30932542a631f (diff) |
Fix crash when IntervalMapOverlaps::advanceTo moves past the last overlap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/IntervalMapTest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/unittests/ADT/IntervalMapTest.cpp b/unittests/ADT/IntervalMapTest.cpp index e0d95a1408..eb1f1a4b03 100644 --- a/unittests/ADT/IntervalMapTest.cpp +++ b/unittests/ADT/IntervalMapTest.cpp @@ -586,7 +586,11 @@ TEST(IntervalMapOverlapsTest, SmallMaps) { ASSERT_TRUE(BA.valid()); EXPECT_EQ(3u, BA.a().start()); EXPECT_EQ(4u, BA.b().start()); - ++BA; + // advance past end. + BA.advanceTo(6); + EXPECT_FALSE(BA.valid()); + // advance an invalid iterator. + BA.advanceTo(7); EXPECT_FALSE(BA.valid()); } |