diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-02-27 13:06:10 +0400 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-02-27 13:06:10 +0400 |
commit | a1a3a2ffc3f52db82f475b91171720bd0333e307 (patch) | |
tree | d7cb284adf4a7dd144c4db809a8b0e1adb12248d /compiler-rt | |
parent | 7a5fdd874633c868d03b0b68e086fcc131483dd6 (diff) |
AddressSanitizer: add some checks to AsanChunkFifoList::PushList
llvm-svn: 151521
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/asan/asan_allocator.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.cc b/compiler-rt/lib/asan/asan_allocator.cc index 5ac22df61b9c..89746eb618f4 100644 --- a/compiler-rt/lib/asan/asan_allocator.cc +++ b/compiler-rt/lib/asan/asan_allocator.cc @@ -249,6 +249,7 @@ static AsanChunk *PtrToChunk(uintptr_t ptr) { void AsanChunkFifoList::PushList(AsanChunkFifoList *q) { + CHECK(q->size() > 0); if (last_) { CHECK(first_); CHECK(!last_->next); @@ -258,7 +259,10 @@ void AsanChunkFifoList::PushList(AsanChunkFifoList *q) { CHECK(!first_); last_ = q->last_; first_ = q->first_; + CHECK(first_); } + CHECK(last_); + CHECK(!last_->next); size_ += q->size(); q->clear(); } |