From c90de6375e729642231160cd68902e4782894579 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 21 Jun 2019 16:15:09 +0000 Subject: [PATCH] [asan] Avoid two compiler-synthesized calls to memset & memcpy Otherwise the tests hang on Windows attempting to report nested errors. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D63627 llvm-svn: 364070 --- compiler-rt/lib/asan/asan_globals.cc | 7 ++----- .../lib/sanitizer_common/sanitizer_symbolizer_win.cc | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler-rt/lib/asan/asan_globals.cc b/compiler-rt/lib/asan/asan_globals.cc index 8b2fdb214fe8..a831fdf9cd93 100644 --- a/compiler-rt/lib/asan/asan_globals.cc +++ b/compiler-rt/lib/asan/asan_globals.cc @@ -115,15 +115,12 @@ int GetGlobalsForAddress(uptr addr, Global *globals, u32 *reg_sites, 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; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc index d75fe9ae1663..1badcf5f0a35 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc @@ -35,6 +35,9 @@ namespace { 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;