Skip to content

[Frontend] Don't ask to report bugs for a script failure #39619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,15 @@ int swift::performFrontend(ArrayRef<const char *> Args,
return finishDiagProcessing(1, /*verifierEnabled*/ false);
}

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

PrettyStackTraceFrontend frontendTrace(Invocation.getLangOptions());

// Make an array of PrettyStackTrace objects to dump the configuration files
Expand Down
9 changes: 9 additions & 0 deletions test/Frontend/immediate-mode-crash.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Don't ask to file a bug report on a script failure.

// REQUIRES: swift_interpreter

// RUN: not --crash %target-swift-frontend -interpret %s 2>&1 | %FileCheck %s

assert(false)
// CHECK: Assertion failed
// CHECK-NOT: Please submit a bug report