[PATCH] D63627: [asan] Avoid two compiler-synthesized calls to memset & memcpy

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 09:04:08 PDT 2019


rnk marked an inline comment as done.
rnk added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc:39
+  WinSymbolizerTool(bool avoid_memset) {
+    (void)avoid_memset;  // Avoids a compiler-synthesized call to memset.
+  }
----------------
vitalybuka wrote:
> How does this help to avoid memset?
Actually, I think the boolean is unnecessary. The constructor has to be user-provided. If it's compiler-synthesized, then the compiler zeros out the memory before calling the constructor, as in this code:
```
struct Foo {
  Foo()
#ifdef USER_CTOR
  {}
#else
  = default;
#endif
  int x = 0;
};
Foo *getit() { return new Foo(); }
```

I'll simplify it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63627





More information about the llvm-commits mailing list