[compiler-rt] r259085 - [cfi] Simplify the code in CfiSlowPathCommon.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 11:58:27 PST 2016


Author: eugenis
Date: Thu Jan 28 13:58:26 2016
New Revision: 259085

URL: http://llvm.org/viewvc/llvm-project?rev=259085&view=rev
Log:
[cfi] Simplify the code in CfiSlowPathCommon.

Modified:
    compiler-rt/trunk/lib/cfi/cfi.cc

Modified: compiler-rt/trunk/lib/cfi/cfi.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/cfi/cfi.cc?rev=259085&r1=259084&r2=259085&view=diff
==============================================================================
--- compiler-rt/trunk/lib/cfi/cfi.cc (original)
+++ compiler-rt/trunk/lib/cfi/cfi.cc Thu Jan 28 13:58:26 2016
@@ -303,20 +303,15 @@ ALWAYS_INLINE void CfiSlowPathCommon(u64
   VReport(3, "__cfi_slowpath: %llx, %p\n", CallSiteTypeId, Ptr);
   ShadowValue sv = ShadowValue::load(Addr);
   if (sv.is_invalid()) {
-    // FIXME: call the ubsan handler if DiagData != nullptr?
     VReport(1, "CFI: invalid memory region for a check target: %p\n", Ptr);
 #ifdef CFI_ENABLE_DIAG
     if (DiagData) {
       __ubsan_handle_cfi_check_fail(
-          reinterpret_cast<__ubsan::CFICheckFailData *>(DiagData),
-          reinterpret_cast<uptr>(Ptr));
+          reinterpret_cast<__ubsan::CFICheckFailData *>(DiagData), Addr);
       return;
-    } else {
-      Trap();
     }
-#else
-    Trap();
 #endif
+    Trap();
   }
   if (sv.is_unchecked()) {
     VReport(2, "CFI: unchecked call (shadow=FFFF): %p\n", Ptr);




More information about the llvm-commits mailing list