Skip to content

Commit 6d3455f

Browse files
authored
Merge pull request #81849 from hamishknight/message-in-an-error
[Basic] Always dump message to stderr in `_abortWithMessage`
2 parents dd75d2e + b9b2cb2 commit 6d3455f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Basic/Assertions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ static void _abortWithMessage(llvm::StringRef message) {
123123
// crash reporter.
124124
PrettyStackTraceMultilineString trace(message);
125125

126-
// If pretty backtracing is disabled, fall back to dumping to stderr.
127-
if (!llvm::SavePrettyStackState())
128-
llvm::errs() << message << '\n';
126+
// Also dump to stderr in case pretty backtracing is disabled, and to
127+
// allow the message to be seen while attached with a debugger.
128+
llvm::errs() << message << '\n';
129129

130130
abort();
131131
}

test/Serialization/Recovery/crash-recovery.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Sub: Base {
1616
// CHECK-CRASH: error: fatal error encountered while reading from module 'Lib'; please submit a bug report (https://swift.org/contributing/#reporting-bugs){{$}}
1717
// CHECK-CRASH-4: Compiling with effective version 4.1.50
1818
// CHECK-CRASH-4_2: Compiling with effective version 4.2
19-
// CHECK-CRASH: While loading members for 'Sub' (in module 'Lib')
19+
// CHECK-CRASH-LABEL: While loading members for 'Sub' (in module 'Lib')
2020
// CHECK-CRASH-LABEL: *** DESERIALIZATION FAILURE ***
2121
// CHECK-CRASH-LABEL: *** If any module named here was modified in the SDK, please delete the ***
2222
// CHECK-CRASH-LABEL: *** new swiftmodule files from the SDK and keep only swiftinterfaces. ***

0 commit comments

Comments
 (0)