[PATCH] D29786: Use pthreads to manage thread-local storage on darwin for leak sanitizer

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 11:31:09 PST 2017


fjricci added inline comments.


================
Comment at: lib/lsan/lsan_common_mac.cc:35
+  if (ptr == NULL && allocate) {
+    ptr = (int *)malloc(sizeof(0));
+    *ptr = 0;
----------------
kubamracek wrote:
> sizeof(int)
Using `sizeof(int)` fails the check-sanitizer linter:

Using sizeof(type).  Use sizeof(varname) instead if possible  [runtime/sizeof] [1]


https://reviews.llvm.org/D29786





More information about the llvm-commits mailing list