Skip to content

Commit 8cac036

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 287c1d7 commit 8cac036

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
@@ -141,6 +141,7 @@ add_swift_target_library(swiftRuntime OBJECT_LIBRARY
141141
${swift_runtime_threading_sources}
142142
C_COMPILE_FLAGS
143143
${swift_runtime_library_compile_flags}
144+
${swift_enable_backtracing}
144145
LINK_FLAGS ${swift_runtime_linker_flags}
145146
SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
146147
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)