[PATCH] D36430: [asan] Restore dead-code-elimination optimization for Fuchsia

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 15:46:13 PDT 2017


mcgrathr added inline comments.


================
Comment at: lib/asan/asan_malloc_linux.cc:35
   uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym;
-  return off < sizeof(alloc_memory_for_dlsym);
+  return off < allocated_for_dlsym * sizeof(alloc_memory_for_dlsym[0]);
 }
----------------
vitalybuka wrote:
> Maybe just to guard #if !defined(SANITIZER_FUCHSIA)
> from line 29 to 64, and create empty implementation in #else section
> 
> 
> 
So, you mean exactly what I had originally in https://reviews.llvm.org/D36190?id=109395 before you asked me to change it to avoid #if tests?  Really?

I'll change it back if you want.  But you actually did convince me that avoiding #if here was better.
If you are concerned about the correctness of this change (which I don't think you should be), then I can add a simple "&& !SANITIZER_FUCHSIA" short-circuit instead of this change.


Repository:
  rL LLVM

https://reviews.llvm.org/D36430





More information about the llvm-commits mailing list