diff options
author | Kostya Serebryany <kcc@google.com> | 2015-12-21 19:09:01 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-12-21 19:09:01 +0000 |
commit | 9b9dd84c8eccc50c7258c5cd196b3f21fb9ecc04 (patch) | |
tree | f1b6590723325d5696656c0dcfc886dcaef30c36 /llvm/unittests/Support/TrailingObjectsTest.cpp | |
parent | 2b65ed306d1498e42c2a4e2b460eee7d9cf9bbfb (diff) | |
download | bcm5719-llvm-9b9dd84c8eccc50c7258c5cd196b3f21fb9ecc04.tar.gz bcm5719-llvm-9b9dd84c8eccc50c7258c5cd196b3f21fb9ecc04.zip |
fix leak in a test, make the sanitizer bot green
llvm-svn: 256179
Diffstat (limited to 'llvm/unittests/Support/TrailingObjectsTest.cpp')
-rw-r--r-- | llvm/unittests/Support/TrailingObjectsTest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/unittests/Support/TrailingObjectsTest.cpp b/llvm/unittests/Support/TrailingObjectsTest.cpp index 2b8ab4c5fb8..4c05d665f98 100644 --- a/llvm/unittests/Support/TrailingObjectsTest.cpp +++ b/llvm/unittests/Support/TrailingObjectsTest.cpp @@ -164,7 +164,8 @@ TEST(TrailingObjects, ThreeArg) { sizeof(double) + sizeof(short) + 3 * sizeof(bool)); EXPECT_EQ(sizeof(Class3), llvm::RoundUpToAlignment(1, llvm::alignOf<double>())); - Class3 *C = reinterpret_cast<Class3 *>(::operator new(1000)); + std::unique_ptr<char[]> P(new char[1000]); + Class3 *C = reinterpret_cast<Class3 *>(P.get()); EXPECT_EQ(C->getTrailingObjects<double>(), reinterpret_cast<double *>(C + 1)); EXPECT_EQ(C->getTrailingObjects<short>(), reinterpret_cast<short *>(reinterpret_cast<double *>(C + 1) + 1)); |