forked from OSchip/llvm-project
[asan] Allow re-exec in instrumented unit tests on Darwin (fix unit tests on macOS <=10.10)
This fixes https://llvm.org/bugs/show_bug.cgi?id=30285. On macOS 10.10 and lower, instrumented unit tests still need to be able to re-exec to make interceptors work. Differential Revision: https://reviews.llvm.org/D24699 llvm-svn: 288224
This commit is contained in:
parent
86bd29afda
commit
4edffbd28c
|
@ -28,9 +28,18 @@ extern "C" const char* __asan_default_options() {
|
|||
|
||||
namespace __sanitizer {
|
||||
bool ReexecDisabled() {
|
||||
#if __has_feature(address_sanitizer) && SANITIZER_MAC
|
||||
// Allow re-exec in instrumented unit tests on Darwin. Technically, we only
|
||||
// need this for 10.10 and below, where re-exec is required for the
|
||||
// interceptors to work, but to avoid duplicating the version detection logic,
|
||||
// let's just allow re-exec for all Darwin versions. On newer OS versions,
|
||||
// returning 'false' doesn't do anything anyway, because we don't re-exec.
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} // namespace __sanitizer
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
testing::GTEST_FLAG(death_test_style) = "threadsafe";
|
||||
|
|
Loading…
Reference in New Issue