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 only affects the SPARC ports and has been tested on SPARC/Solaris 
and SPARC64/Linux.

It merges r355979 of the LLVM repository.  Installed on the mainline.


2019-03-13  Eric Botcazou  <ebotca...@adacore.com>

        PR sanitizer/80953
        Merge from LLVM revision 355979
        * asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to
        copy Global objects for SPARC with GCC.

-- 
Eric Botcazou
Index: asan/asan_globals.cc
===================================================================
--- asan/asan_globals.cc	(revision 269546)
+++ asan/asan_globals.cc	(working copy)
@@ -112,7 +112,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++;

Reply via email to