Skip to content

Commit 003b455

Browse files
committed
[Backtracing] Fix a Windows build issue.
When backtracing is disabled, don't try to refer to `_swift_backtraceSettings`. rdar://117470489
1 parent d84c471 commit 003b455

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ add_swift_target_library(swiftRuntime OBJECT_LIBRARY
151151
${swift_runtime_threading_sources}
152152
C_COMPILE_FLAGS
153153
${swift_runtime_library_compile_flags}
154+
${swift_enable_backtracing}
154155
LINK_FLAGS ${swift_runtime_linker_flags}
155156
SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
156157
INSTALL_IN_COMPONENT never_install)

stdlib/public/runtime/Errors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void swift::swift_reportError(uint32_t flags,
354354
const char *message) {
355355
#if defined(__APPLE__) && NDEBUG
356356
flags &= ~FatalErrorFlags::ReportBacktrace;
357-
#else
357+
#elif SWIFT_ENABLE_BACKTRACING
358358
// Disable fatalError backtraces if the backtracer is enabled
359359
if (runtime::backtrace::_swift_backtrace_isEnabled()) {
360360
flags &= ~FatalErrorFlags::ReportBacktrace;

0 commit comments

Comments
 (0)