From 629f3b229e58bd930f87a9a3c01aec52daf5bc87 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Thu, 19 Dec 2013 02:35:26 +0000 Subject: Fix a buffer overrun detected by AddressSanitizer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197647 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ADT/BitVectorTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unittests') diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index d7cde891fb5..3deaff0fe35 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -356,6 +356,12 @@ TYPED_TEST(BitVectorTest, RangeOps) { EXPECT_TRUE( E.test(1)); EXPECT_TRUE( E.test(32)); EXPECT_FALSE(E.test(33)); + + TypeParam BufferOverrun; + unsigned size = sizeof(unsigned long) * 8; + BufferOverrun.resize(size); + BufferOverrun.reset(0, size); + BufferOverrun.set(0, size); } TYPED_TEST(BitVectorTest, CompoundTestReset) { -- cgit v1.2.3