[compiler-rt] r355979 - AddressSanitizer: fix for SPARC with GCC
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 14:02:16 PDT 2019
Author: vitalybuka
Date: Tue Mar 12 14:02:15 2019
New Revision: 355979
URL: http://llvm.org/viewvc/llvm-project?rev=355979&view=rev
Log:
AddressSanitizer: fix for SPARC with GCC
Summary:
This patch contains a fixlet for the AddressSanitizer on the SPARC with GCC, which would otherwise generate a problematic call to the intercepted memcpy routine. It was tested with GCC on SPARC/Solaris and SPARC/Linux.
Patch by Eric Botcazou.
Reviewers: #sanitizers, vitalybuka
Reviewed By: #sanitizers, vitalybuka
Subscribers: vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58433
Modified:
compiler-rt/trunk/lib/asan/asan_globals.cc
Modified: compiler-rt/trunk/lib/asan/asan_globals.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_globals.cc?rev=355979&r1=355978&r2=355979&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_globals.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_globals.cc Tue Mar 12 14:02:15 2019
@@ -115,7 +115,11 @@ int GetGlobalsForAddress(uptr addr, Glob
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++;
More information about the llvm-commits
mailing list