aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/ErrorHandling.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>2022-05-30 19:16:06 +0100
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>2022-05-30 19:19:23 +0100
commit80b3dcc045f8ea6e5e532d8891bbf1305bce89e8 (patch)
treea5f204b60e44a2f016f2c5b054841d16340d8cad /llvm/lib/Support/ErrorHandling.cpp
parentc4eb8035ed6647e58d4c5161f393e9220f7402cf (diff)
downloadllvm-80b3dcc045f8ea6e5e532d8891bbf1305bce89e8.zip
llvm-80b3dcc045f8ea6e5e532d8891bbf1305bce89e8.tar.gz
llvm-80b3dcc045f8ea6e5e532d8891bbf1305bce89e8.tar.bz2
[Support] Make report_fatal_error respect its GenCrashDiag argument so it doesn't generate a backtrace
There are a few places where we use report_fatal_error when the input is broken. Currently, this function always crashes LLVM with an abort signal, which then triggers the backtrace printing code. I think this is excessive, as wrong input shouldn't give a link to LLVM's github issue URL and tell users to file a bug report. We shouldn't print a stack trace either. This patch changes report_fatal_error so it uses exit() rather than abort() when its argument GenCrashDiag=false. Reviewed by: nikic, MaskRay, RKSimon Differential Revision: https://reviews.llvm.org/D126550
Diffstat (limited to 'llvm/lib/Support/ErrorHandling.cpp')
-rw-r--r--llvm/lib/Support/ErrorHandling.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index 80c0e00..3acae3f 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -119,7 +119,10 @@ void llvm::report_fatal_error(const Twine &Reason, bool GenCrashDiag) {
// files registered with RemoveFileOnSignal.
sys::RunInterruptHandlers();
- abort();
+ if (GenCrashDiag)
+ abort();
+ else
+ exit(126);
}
void llvm::install_bad_alloc_error_handler(fatal_error_handler_t handler,