Skip to content

Commit f01d84c

Browse files
Merge pull request swiftlang#15132 from aschwaighofer/fix_linux_link_issue_attempt
Speculative fix for linux bot linker failure
2 parents 4ea8956 + e106161 commit f01d84c

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

include/swift/Runtime/Debug.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ void _swift_reportToDebugger(uintptr_t flags, const char *message,
224224
SWIFT_RUNTIME_STDLIB_SPI
225225
bool _swift_reportFatalErrorsToDebugger;
226226

227+
SWIFT_RUNTIME_STDLIB_SPI
228+
bool _swift_shouldReportFatalErrorsToDebugger();
229+
230+
227231
LLVM_ATTRIBUTE_ALWAYS_INLINE
228232
inline static int swift_asprintf(char **strp, const char *fmt, ...) {
229233
va_list args;

stdlib/public/runtime/Errors.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ void swift::_swift_reportToDebugger(uintptr_t flags, const char *message,
292292
_swift_runtime_on_report(flags, message, details);
293293
}
294294

295+
bool swift::_swift_reportFatalErrorsToDebugger = true;
296+
297+
bool swift::_swift_shouldReportFatalErrorsToDebugger() {
298+
return _swift_reportFatalErrorsToDebugger;
299+
}
300+
295301
/// Report a fatal error to system console, stderr, and crash logs.
296302
/// Does not crash by itself.
297303
void swift::swift_reportError(uint32_t flags,

stdlib/public/runtime/SwiftObject.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ static bool usesNativeSwiftReferenceCounting_nonNull(
13981398
"withoutActuallyEscaping block";
13991399
auto messageLength = strlen(message);
14001400

1401-
if (_swift_reportFatalErrorsToDebugger)
1401+
if (_swift_shouldReportFatalErrorsToDebugger())
14021402
_swift_reportToDebugger(RuntimeErrorFlagFatal, message);
14031403

14041404
char *log;

stdlib/public/stubs/Assert.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121

2222
using namespace swift;
2323

24-
bool swift::_swift_reportFatalErrorsToDebugger = true;
25-
2624
static void logPrefixAndMessageToDebugger(
2725
const unsigned char *prefix, int prefixLength,
2826
const unsigned char *message, int messageLength
2927
) {
30-
if (!_swift_reportFatalErrorsToDebugger)
28+
if (!_swift_shouldReportFatalErrorsToDebugger())
3129
return;
3230

3331
char *debuggerMessage;

0 commit comments

Comments
 (0)