Fix new ASAN failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -61,8 +61,8 @@ int main()
|
|||||||
C c(std::begin(t), std::end(t));
|
C c(std::begin(t), std::end(t));
|
||||||
c.reserve(2*c.size());
|
c.reserve(2*c.size());
|
||||||
assert(is_contiguous_container_asan_correct(c));
|
assert(is_contiguous_container_asan_correct(c));
|
||||||
assert(!__sanitizer_verify_contiguous_container ( c.data(), c.data() + 1, c.data() + c.capacity()));
|
assert(!__sanitizer_verify_contiguous_container( c.data(), c.data() + 1, c.data() + c.capacity()));
|
||||||
T foo = c[c.size()]; // should trigger ASAN
|
volatile T foo = c[c.size()]; // should trigger ASAN. Use volatile to prevent being optimized away.
|
||||||
assert(false); // if we got here, ASAN didn't trigger
|
assert(false); // if we got here, ASAN didn't trigger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,5 @@ struct B : A {};
|
|||||||
int main() {
|
int main() {
|
||||||
A* ptr = new B;
|
A* ptr = new B;
|
||||||
(void)dynamic_cast<B*>(ptr);
|
(void)dynamic_cast<B*>(ptr);
|
||||||
|
delete ptr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user