1 //===-- scudo_termination.cpp -----------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// This file contains bare-bones termination functions to replace the
11 /// __sanitizer ones, in order to avoid any potential abuse of the callbacks
12 /// functionality.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #include "scudo_utils.h"
17
18 #include "sanitizer_common/sanitizer_common.h"
19
20 namespace __sanitizer {
21
AddDieCallback(DieCallbackType Callback)22 bool AddDieCallback(DieCallbackType Callback) { return true; }
23
RemoveDieCallback(DieCallbackType Callback)24 bool RemoveDieCallback(DieCallbackType Callback) { return true; }
25
SetUserDieCallback(DieCallbackType Callback)26 void SetUserDieCallback(DieCallbackType Callback) {}
27
Die()28 void NORETURN Die() {
29 if (common_flags()->abort_on_error)
30 Abort();
31 internal__exit(common_flags()->exitcode);
32 }
33
SetCheckFailedCallback(CheckFailedCallbackType callback)34 void SetCheckFailedCallback(CheckFailedCallbackType callback) {}
35
CheckFailed(const char * File,int Line,const char * Condition,u64 Value1,u64 Value2)36 void NORETURN CheckFailed(const char *File, int Line, const char *Condition,
37 u64 Value1, u64 Value2) {
38 __scudo::dieWithMessage("CHECK failed at %s:%d %s (%lld, %lld)\n",
39 File, Line, Condition, Value1, Value2);
40 }
41
42 } // namespace __sanitizer
43