[PATCH] D92880: scudo: Split setRandomTag in two. NFCI.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 09:36:52 PST 2020


hctim accepted this revision.
hctim added a comment.
This revision is now accepted and ready to land.

LGTM w/ nits.



================
Comment at: compiler-rt/lib/scudo/standalone/memtag.h:106
 
-  2:
-  )"
-      :
-      [TaggedPtr] "=&r"(*TaggedBegin), [Cur] "=&r"(*TaggedEnd), [End] "=&r"(End)
-      : [Ptr] "r"(Ptr), [Size] "r"(Size), [ExcludeMask] "r"(ExcludeMask)
-      : "memory");
+inline uptr storeTags(uptr Begin, uptr End) {
+  if (Begin != End) {
----------------
Worth a `DCHECK` that `Begin` and `End` are granule-aligned (and in selectRandomTag)?


================
Comment at: compiler-rt/lib/scudo/standalone/memtag.h:107
+inline uptr storeTags(uptr Begin, uptr End) {
+  if (Begin != End) {
+    __asm__ __volatile__(
----------------
Probably better to be safe and make this `if (Begin < End)`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92880/new/

https://reviews.llvm.org/D92880



More information about the llvm-commits mailing list