Commit 2513250b authored by Kostya Kortchinsky's avatar Kostya Kortchinsky Committed by Mitch Phillips
Browse files

[scudo][standalone] Lists fix

Summary:
Apparently during the review of D69265, and my flailing around with
git, a somewhat important line disappeared.

On top of that, there was no test exercising that code path, and
while writing the follow up patch I intended to write, some `CHECK`s
were failing.

Re-add the missing line, and add a test that fails without said line.

Reviewers: hctim, morehouse, pcc, cferris

Reviewed By: hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69529
parent d83a2faa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ template <class T> struct DoublyLinkedList : IntrusiveList<T> {
      Last = X;
    } else {
      DCHECK_EQ(First->Prev, nullptr);
      First->Prev = X;
    }
    X->Next = First;
    First = X;
+14 −0
Original line number Diff line number Diff line
@@ -194,4 +194,18 @@ TEST(ScudoListTest, DoublyLinkedList) {
  L.checkConsistency();
  L.pop_front();
  EXPECT_TRUE(L.empty());

  L.push_back(X);
  L.insert(Y, X);
  EXPECT_EQ(L.size(), 2U);
  EXPECT_EQ(L.front(), Y);
  EXPECT_EQ(L.back(), X);
  L.checkConsistency();
  L.remove(Y);
  EXPECT_EQ(L.size(), 1U);
  EXPECT_EQ(L.front(), X);
  EXPECT_EQ(L.back(), X);
  L.checkConsistency();
  L.pop_front();
  EXPECT_TRUE(L.empty());
}