1 //===-- scudo_termination.cpp -----------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 /// This file contains bare-bones termination functions to replace the
10 /// __sanitizer ones, in order to avoid any potential abuse of the callbacks
13 //===----------------------------------------------------------------------===//
15 #include "scudo_utils.h"
17 #include "sanitizer_common/sanitizer_common.h"
19 namespace __sanitizer {
21 bool AddDieCallback(DieCallbackType Callback) { return true; }
23 bool RemoveDieCallback(DieCallbackType Callback) { return true; }
25 void SetUserDieCallback(DieCallbackType Callback) {}
28 if (common_flags()->abort_on_error)
30 internal__exit(common_flags()->exitcode);
33 void SetCheckFailedCallback(CheckFailedCallbackType callback) {}
35 void NORETURN CheckFailed(const char *File, int Line, const char *Condition,
36 u64 Value1, u64 Value2) {
37 __scudo::dieWithMessage("CHECK failed at %s:%d %s (%lld, %lld)\n",
38 File, Line, Condition, Value1, Value2);
41 } // namespace __sanitizer