[PATCH] D58433: AddressSanitizer: fix for SPARC with GCC

Eric Botcazou via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 06:55:04 PST 2019


ebotcazou updated this revision to Diff 187789.
ebotcazou marked 3 inline comments as done.
ebotcazou added a comment.

Changed sizeof (Global) to sizeof (g) and removed extraneous space.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58433

Files:
  compiler-rt/lib/asan/asan_globals.cc


Index: compiler-rt/lib/asan/asan_globals.cc
===================================================================
--- compiler-rt/lib/asan/asan_globals.cc
+++ compiler-rt/lib/asan/asan_globals.cc
@@ -115,7 +115,11 @@
     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++;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58433.187789.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190221/7ced4dbb/attachment.bin>


More information about the llvm-commits mailing list