[compiler-rt] r231402 - Move use of __builtin_longjmp under the same conditions as the only

Joerg Sonnenberger joerg at bec.de
Thu Mar 5 12:17:05 PST 2015


Author: joerg
Date: Thu Mar  5 14:17:05 2015
New Revision: 231402

URL: http://llvm.org/viewvc/llvm-project?rev=231402&view=rev
Log:
Move use of __builtin_longjmp under the same conditions as the only
caller of the function.

Modified:
    compiler-rt/trunk/lib/asan/tests/asan_test.cc

Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=231402&r1=231401&r2=231402&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Thu Mar  5 14:17:05 2015
@@ -569,7 +569,7 @@ TEST(AddressSanitizer, LongJmpTest) {
 }
 
 #if !defined(_WIN32)  // Only basic longjmp is available on Windows.
-NOINLINE void BuiltinLongJmpFunc1(jmp_buf buf) {
+NOINLINE void UnderscopeLongJmpFunc1(jmp_buf buf) {
   // create three red zones for these two stack objects.
   int a;
   int b;
@@ -577,10 +577,10 @@ NOINLINE void BuiltinLongJmpFunc1(jmp_bu
   int *A = Ident(&a);
   int *B = Ident(&b);
   *A = *B;
-  __builtin_longjmp((void**)buf, 1);
+  _longjmp(buf, 1);
 }
 
-NOINLINE void UnderscopeLongJmpFunc1(jmp_buf buf) {
+NOINLINE void SigLongJmpFunc1(sigjmp_buf buf) {
   // create three red zones for these two stack objects.
   int a;
   int b;
@@ -588,10 +588,13 @@ NOINLINE void UnderscopeLongJmpFunc1(jmp
   int *A = Ident(&a);
   int *B = Ident(&b);
   *A = *B;
-  _longjmp(buf, 1);
+  siglongjmp(buf, 1);
 }
 
-NOINLINE void SigLongJmpFunc1(sigjmp_buf buf) {
+#if !defined(__ANDROID__) && !defined(__arm__) && \
+    !defined(__powerpc64__) && !defined(__powerpc__) && \
+    !defined(__aarch64__)
+NOINLINE void BuiltinLongJmpFunc1(jmp_buf buf) {
   // create three red zones for these two stack objects.
   int a;
   int b;
@@ -599,12 +602,9 @@ NOINLINE void SigLongJmpFunc1(sigjmp_buf
   int *A = Ident(&a);
   int *B = Ident(&b);
   *A = *B;
-  siglongjmp(buf, 1);
+  __builtin_longjmp((void**)buf, 1);
 }
 
-#if !defined(__ANDROID__) && !defined(__arm__) && \
-    !defined(__powerpc64__) && !defined(__powerpc__) && \
-    !defined(__aarch64__)
 // Does not work on Power and ARM:
 // https://code.google.com/p/address-sanitizer/issues/detail?id=185
 TEST(AddressSanitizer, BuiltinLongJmpTest) {





More information about the llvm-commits mailing list