AddressSanitizer: add some checks to AsanChunkFifoList::PushList

llvm-svn: 151521
This commit is contained in:
Alexey Samsonov 2012-02-27 09:06:10 +00:00
parent 7a5fdd8746
commit a1a3a2ffc3
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}