[PATCH] D49939: [ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 15:51:39 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL338650: [ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64. (authored by jhb, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D49939

Files:
  llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/trunk/test/Instrumentation/AddressSanitizer/freebsd.ll


Index: llvm/trunk/test/Instrumentation/AddressSanitizer/freebsd.ll
===================================================================
--- llvm/trunk/test/Instrumentation/AddressSanitizer/freebsd.ll
+++ llvm/trunk/test/Instrumentation/AddressSanitizer/freebsd.ll
@@ -8,6 +8,11 @@
 ; RUN:     -data-layout="e-m:e-i64:64-f80:128-n8:16:32:64-S128" | \
 ; RUN:     FileCheck --check-prefix=CHECK-64 %s
 
+; RUN: opt < %s -asan -asan-module -S \
+; RUN:     -mtriple=mips64-unknown-freebsd \
+; RUN:     -data-layout="E-m:e-i64:64-n32:64-S128" | \
+; RUN:     FileCheck --check-prefix=CHECK-MIPS64 %s
+
 define i32 @read_4_bytes(i32* %a) sanitize_address {
 entry:
   %tmp1 = load i32, i32* %a, align 4
@@ -27,3 +32,10 @@
 ; CHECK-64: lshr {{.*}} 3
 ; CHECK-64-NEXT: {{70368744177664}}
 ; CHECK-64: ret
+
+; CHECK-MIPS64: @read_4_bytes
+; CHECK-MIPS64-NOT: ret
+; Check for ASAN's Offset for 64-bit (2^37 or 0x2000000000)
+; CHECK-MIPS64: lshr {{.*}} 3
+; CHECK-MIPS64-NEXT: {{137438953472}}
+; CHECK-MIPS64: ret
Index: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -538,7 +538,7 @@
       Mapping.Offset = kPPC64_ShadowOffset64;
     else if (IsSystemZ)
       Mapping.Offset = kSystemZ_ShadowOffset64;
-    else if (IsFreeBSD)
+    else if (IsFreeBSD && !IsMIPS64)
       Mapping.Offset = kFreeBSD_ShadowOffset64;
     else if (IsNetBSD)
       Mapping.Offset = kNetBSD_ShadowOffset64;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49939.158657.patch
Type: text/x-patch
Size: 1605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180801/f7a5503f/attachment.bin>


More information about the llvm-commits mailing list