[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:15:28 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364070: [asan] Avoid two compiler-synthesized calls to memset & memcpy (authored by rnk, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D63627?vs=205913&id=206016#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63627

Files:
  compiler-rt/trunk/lib/asan/asan_globals.cc
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc


Index: compiler-rt/trunk/lib/asan/asan_globals.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_globals.cc
+++ compiler-rt/trunk/lib/asan/asan_globals.cc
@@ -115,15 +115,12 @@
     if (flags()->report_globals >= 2)
       ReportGlobal(g, "Search");
     if (IsAddressNearGlobal(addr, g)) {
-#if defined(__GNUC__) && defined(__sparc__)
       internal_memcpy(&globals[res], &g, sizeof(g));
-#else
-      globals[res] = g;
-#endif
       if (reg_sites)
         reg_sites[res] = FindRegistrationSite(&g);
       res++;
-      if (res == max_globals) break;
+      if (res == max_globals)
+        break;
     }
   }
   return res;
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc
@@ -35,6 +35,9 @@
 
 class WinSymbolizerTool : public SymbolizerTool {
  public:
+  // The constructor is provided to avoid synthesized memsets.
+  WinSymbolizerTool() {}
+
   bool SymbolizePC(uptr addr, SymbolizedStack *stack) override;
   bool SymbolizeData(uptr addr, DataInfo *info) override {
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63627.206016.patch
Type: text/x-patch
Size: 1288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190621/dbc7ce54/attachment.bin>


More information about the llvm-commits mailing list