diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp --- a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp @@ -31,7 +31,7 @@ volatile int y = 1; volatile int z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, z10, z11, z12, z13; -void recursive_func(char *p) { +void recursive_func(uintptr_t parent_frame_address) { #if defined(SMALL_FRAME) char *buf = 0; #elif defined(SAVE_ALL_THE_REGISTERS) @@ -69,14 +69,13 @@ #else char buf[BS]; // Check that the stack grows in the righ direction, unless we use fake stack. - if (p && !__asan_get_current_fake_stack()) - assert(p - buf >= BS); + assert(parent_frame_address > (uintptr_t)__builtin_frame_address(0)); buf[rand() % BS] = 1; buf[rand() % BS] = 2; x = buf[rand() % BS]; #endif if (y) - recursive_func(buf); + recursive_func((uintptr_t)__builtin_frame_address(0)); x = 1; // prevent tail call optimization // CHECK: {{stack-overflow on address 0x.* \(pc 0x.* bp 0x.* sp 0x.* T.*\)}} // If stack overflow happens during function prologue, stack trace may be @@ -85,7 +84,7 @@ } void *ThreadFn(void* unused) { - recursive_func(0); + recursive_func((uintptr_t)__builtin_frame_address(0)); return 0; } @@ -110,7 +109,7 @@ pthread_create(&t, 0, ThreadFn, 0); pthread_join(t, 0); #else - recursive_func(0); + recursive_func((uintptr_t)__builtin_frame_address(0)); #endif return 0; } diff --git a/compiler-rt/test/asan/TestCases/contiguous_container.cpp b/compiler-rt/test/asan/TestCases/contiguous_container.cpp --- a/compiler-rt/test/asan/TestCases/contiguous_container.cpp +++ b/compiler-rt/test/asan/TestCases/contiguous_container.cpp @@ -65,11 +65,7 @@ assert(__asan_address_is_poisoned(x + 14)); ThrowAndCatch(); assert(!__asan_address_is_poisoned(x + 13)); - // FIXME: invert the assertion below once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 14)); + assert(!__asan_address_is_poisoned(x + 14)); __sanitizer_annotate_contiguous_container(x, x + 32, x + 14, x + 32); assert(!__asan_address_is_poisoned(x + 13)); assert(!__asan_address_is_poisoned(x + 14)); diff --git a/compiler-rt/test/asan/TestCases/longjmp.cpp b/compiler-rt/test/asan/TestCases/longjmp.cpp --- a/compiler-rt/test/asan/TestCases/longjmp.cpp +++ b/compiler-rt/test/asan/TestCases/longjmp.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_asan -O %s -o %t && %run %t +// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O %s -o %t && %run %t #include #include @@ -17,9 +17,5 @@ longjmp(buf, 1); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } diff --git a/compiler-rt/test/asan/TestCases/throw_catch.cpp b/compiler-rt/test/asan/TestCases/throw_catch.cpp --- a/compiler-rt/test/asan/TestCases/throw_catch.cpp +++ b/compiler-rt/test/asan/TestCases/throw_catch.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_asan -O %s -o %t && %run %t +// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O %s -o %t && %run %t #include #include @@ -30,11 +30,7 @@ ThrowAndCatch(); fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } __attribute__((noinline)) @@ -50,11 +46,7 @@ } fprintf(stderr, "After: %p poisoned: %d\n", &x, __asan_address_is_poisoned(x + 32)); - // FIXME: Invert this assertion once we fix - // https://code.google.com/p/address-sanitizer/issues/detail?id=258 - // This assertion works only w/o UAR. - if (!__asan_get_current_fake_stack()) - assert(!__asan_address_is_poisoned(x + 32)); + assert(!__asan_address_is_poisoned(x + 32)); } int main(int argc, char **argv) {