[compiler-rt] r293746 - [asan] Support handle_sigfpe on Darwin

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 23:54:37 PST 2017


Author: bogner
Date: Wed Feb  1 01:54:36 2017
New Revision: 293746

URL: http://llvm.org/viewvc/llvm-project?rev=293746&view=rev
Log:
[asan] Support handle_sigfpe on Darwin

Added:
    compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/fpe.cc
      - copied, changed from r293741, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc
Removed:
    compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc
Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=293746&r1=293745&r2=293746&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Wed Feb  1 01:54:36 2017
@@ -402,6 +402,8 @@ bool IsHandledDeadlySignal(int signum) {
     return true;
   if (common_flags()->handle_sigill && signum == SIGILL)
     return true;
+  if (common_flags()->handle_sigfpe && signum == SIGFPE)
+    return true;
   return (signum == SIGSEGV || signum == SIGBUS) && common_flags()->handle_segv;
 }
 

Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc?rev=293745&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc (removed)
@@ -1,30 +0,0 @@
-// Test the handle_sigfpe option.
-// RUN: %clang %s -o %t
-// RUN:                               not         %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s
-// RUN: %env_tool_opts=handle_sigfpe=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
-// RUN: %env_tool_opts=handle_sigfpe=1 not         %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s
-// FIXME: implement in other sanitizers, not just asan.
-// XFAIL: msan
-// XFAIL: lsan
-// XFAIL: tsan
-//
-// FIXME: seems to fail on ARM
-// REQUIRES: x86_64-target-arch
-#include <assert.h>
-#include <stdio.h>
-#include <sanitizer/asan_interface.h>
-
-void death() {
-  fprintf(stderr, "DEATH CALLBACK\n");
-}
-
-int main(int argc, char **argv) {
-  __sanitizer_set_death_callback(death);
-  volatile int one = 1;
-  volatile int zero = 0;
-  volatile int sink;
-  sink = one / zero;
-}
-// CHECK1: ERROR: {{.*}}Sanitizer:
-// CHECK1: DEATH CALLBACK
-// CHECK0-NOT: Sanitizer

Copied: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/fpe.cc (from r293741, compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/fpe.cc?p2=compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/fpe.cc&p1=compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/fpe.cc&r1=293741&r2=293746&rev=293746&view=diff
==============================================================================
    (empty)




More information about the llvm-commits mailing list