1 //===-- ubsan_handlers_cxx.h ------------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // Entry points to the runtime library for Clang's undefined behavior sanitizer,
9 // for C++-specific checks. This code is not linked into C binaries.
11 //===----------------------------------------------------------------------===//
12 #ifndef UBSAN_HANDLERS_CXX_H
13 #define UBSAN_HANDLERS_CXX_H
15 #include "ubsan_value.h"
19 struct DynamicTypeCacheMissData
{
21 const TypeDescriptor
&Type
;
23 unsigned char TypeCheckKind
;
26 /// \brief Handle a runtime type check failure, caused by an incorrect vptr.
27 /// When this handler is called, all we know is that the type was not in the
28 /// cache; this does not necessarily imply the existence of a bug.
29 extern "C" SANITIZER_INTERFACE_ATTRIBUTE
30 void __ubsan_handle_dynamic_type_cache_miss(
31 DynamicTypeCacheMissData
*Data
, ValueHandle Pointer
, ValueHandle Hash
);
32 extern "C" SANITIZER_INTERFACE_ATTRIBUTE
33 void __ubsan_handle_dynamic_type_cache_miss_abort(
34 DynamicTypeCacheMissData
*Data
, ValueHandle Pointer
, ValueHandle Hash
);
37 #endif // UBSAN_HANDLERS_H