[PATCH] D79133: [scudo] Zero- and pattern-initialization of memory.

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 09:35:53 PDT 2020


glider added a comment.

Re: calloc behavior, it probably should not return patter-initialized memory even if pattern initialization is enabled.
A lot of code depend on calloc returning zeroes.



================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:401
         // costly, we might as well mark it as such.
-        memset(Block, 0, PrimaryT::getSizeByClassId(ClassId));
+        memset(Block, FillContents == ZeroFill ? 0 : 0xAB,
+               PrimaryT::getSizeByClassId(ClassId));
----------------
Please make this 0xAB a constant.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79133





More information about the llvm-commits mailing list