[compiler-rt] 083d45b - [dfsan] Fix building OriginAddr at non-linux OS

Jianzhou Zhao via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 21:02:50 PST 2021


Author: Jianzhou Zhao
Date: 2021-02-12T05:02:14Z
New Revision: 083d45b21c1f7651345c1378b7d3302afe8f297a

URL: https://github.com/llvm/llvm-project/commit/083d45b21c1f7651345c1378b7d3302afe8f297a
DIFF: https://github.com/llvm/llvm-project/commit/083d45b21c1f7651345c1378b7d3302afe8f297a.diff

LOG: [dfsan] Fix building OriginAddr at non-linux OS

Fix the broken build by D96545

Added: 
    

Modified: 
    compiler-rt/lib/dfsan/dfsan_platform.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/dfsan/dfsan_platform.h b/compiler-rt/lib/dfsan/dfsan_platform.h
index bf852142cd49..f37cc5b1b35c 100644
--- a/compiler-rt/lib/dfsan/dfsan_platform.h
+++ b/compiler-rt/lib/dfsan/dfsan_platform.h
@@ -103,10 +103,14 @@ uptr ShadowAddr() {
   return MappingArchImpl<MAPPING_SHADOW_ADDR>();
 }
 
-#if defined(__x86_64__)
 ALWAYS_INLINE
-uptr OriginAddr() { return MappingArchImpl<MAPPING_ORIGIN_ADDR>(); }
+uptr OriginAddr() {
+#if defined(__x86_64__)
+  return MappingArchImpl<MAPPING_ORIGIN_ADDR>();
+#else
+  return 0;
 #endif
+}
 
 ALWAYS_INLINE
 uptr UnionTableAddr() {


        


More information about the llvm-commits mailing list