Skip to content

Commit baf032b

Browse files
authored
Merge pull request #39619 from xymus/pls-no-script-bug-reports
[Frontend] Don't ask to report bugs for a script failure
2 parents ab89342 + 69ce3ec commit baf032b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,15 @@ int swift::performFrontend(ArrayRef<const char *> Args,
20342034
return finishDiagProcessing(1, /*verifierEnabled*/ false);
20352035
}
20362036

2037+
// Don't ask clients to report bugs when running a script in immediate mode.
2038+
// When a script asserts the compiler reports the error with the same
2039+
// stacktrace as a compiler crash. From here we can't tell which is which,
2040+
// for now let's not explicitly ask for bug reports.
2041+
if (Invocation.getFrontendOptions().RequestedAction ==
2042+
FrontendOptions::ActionType::Immediate) {
2043+
llvm::setBugReportMsg(nullptr);
2044+
}
2045+
20372046
PrettyStackTraceFrontend frontendTrace(Invocation.getLangOptions());
20382047

20392048
// Make an array of PrettyStackTrace objects to dump the configuration files
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// Don't ask to file a bug report on a script failure.
2+
3+
// REQUIRES: swift_interpreter
4+
5+
// RUN: not --crash %target-swift-frontend -interpret %s 2>&1 | %FileCheck %s
6+
7+
assert(false)
8+
// CHECK: Assertion failed
9+
// CHECK-NOT: Please submit a bug report

0 commit comments

Comments
 (0)