Skip to content

Commit 9c29b62

Browse files
committed
Don't call os_fault if running on a simulator.
1 parent 2882400 commit 9c29b62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcxx/src/log_error.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extern "C" void android_set_abort_message(const char* msg);
1616
#endif // __BIONIC__
1717

1818
#if defined(__APPLE__) && __has_include(<os/reason_private.h>)
19+
# include <TargetConditionals.h>
1920
# include <os/reason_private.h>
2021
#endif
2122

@@ -28,7 +29,7 @@ void log_security_failure(const char* message) noexcept {
2829
fputs(message, stderr);
2930

3031
// On Apple platforms, use the `os_fault_with_payload` OS function that simulates a crash.
31-
#if defined(__APPLE__) && __has_include(<os/reason_private.h>)
32+
#if defined(__APPLE__) && __has_include(<os/reason_private.h>) && !TARGET_OS_SIMULATOR
3233
os_fault_with_payload(
3334
/*reason_namespace=*/OS_REASON_SECURITY,
3435
/*reason_code=*/0,

0 commit comments

Comments
 (0)