[PATCH] D69529: [scudo][standalone] Lists fix

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 13:28:56 PDT 2019


cryptoad created this revision.
cryptoad added reviewers: hctim, morehouse, pcc, cferris.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.

Apparently during the review of D69265 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69529

Files:
  compiler-rt/lib/scudo/standalone/list.h
  compiler-rt/lib/scudo/standalone/tests/list_test.cpp


Index: compiler-rt/lib/scudo/standalone/tests/list_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/list_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/list_test.cpp
@@ -194,4 +194,14 @@
   L.checkConsistency();
   L.pop_front();
   EXPECT_TRUE(L.empty());
+
+  L.push_back(X);
+  L.insert(Y, X);
+  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());
 }
Index: compiler-rt/lib/scudo/standalone/list.h
===================================================================
--- compiler-rt/lib/scudo/standalone/list.h
+++ compiler-rt/lib/scudo/standalone/list.h
@@ -148,6 +148,7 @@
       Last = X;
     } else {
       DCHECK_EQ(First->Prev, nullptr);
+      First->Prev = X;
     }
     X->Next = First;
     First = X;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69529.226742.patch
Type: text/x-patch
Size: 908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191028/00182356/attachment.bin>


More information about the llvm-commits mailing list