Index: compiler-rt/lib/asan/asan_thread.cpp =================================================================== --- compiler-rt/lib/asan/asan_thread.cpp +++ compiler-rt/lib/asan/asan_thread.cpp @@ -366,7 +366,9 @@ bottom = stack_bottom(); } else if (has_fake_stack()) { bottom = fake_stack()->AddrIsInFakeStack(addr); - CHECK(bottom); + if (bottom == 0) { + return 0; + } } else { return 0; } Index: compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp =================================================================== --- compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp +++ compiler-rt/test/asan/TestCases/invalid-pointer-pairs-subtract-success.cpp @@ -1,6 +1,7 @@ // RUN: %clangxx_asan -O0 %s -o %t -mllvm -asan-detect-invalid-pointer-pair // RUN: %env_asan_opts=detect_invalid_pointer_pairs=2 %run %t +// RUN: %env_asan_opts=detect_invalid_pointer_pairs=2,detect_stack_use_after_return=1 %run %t #include #include