[PATCH] D70762: scudo: Add initial memory tagging support.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 12:37:58 PST 2019


pcc added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:248
+        Chunk::UnpackedHeader Header;
+        uptr BlockEnd = BlockUptr + PrimaryT::getSizeByClassId(ClassId);
+        // If possible, try to reuse the UAF tag that was set by deallocate().
----------------
cryptoad wrote:
> There already is a `BlockEnd` variable outside this scope used for the Secondary, maybe reuse it?
> It might be cleaner to initialize it where the allocate is for the Primary, but then performance will suffer due to the extra `getSizeByClassId` in the fast path, which is not ideal.
> If you want to keep it in this block, it seems to be `const`.
I made this variable `const` and renamed the other one to reduce confusion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70762





More information about the llvm-commits mailing list