ubsan_handlers_cxx.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //===-- ubsan_handlers_cxx.h ------------------------------------*- C++ -*-===//
  2. //
  3. // This file is distributed under the University of Illinois Open Source
  4. // License. See LICENSE.TXT for details.
  5. //
  6. //===----------------------------------------------------------------------===//
  7. //
  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.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef UBSAN_HANDLERS_CXX_H
  13. #define UBSAN_HANDLERS_CXX_H
  14. #include "ubsan_value.h"
  15. namespace __ubsan {
  16. struct DynamicTypeCacheMissData {
  17. SourceLocation Loc;
  18. const TypeDescriptor &Type;
  19. void *TypeInfo;
  20. unsigned char TypeCheckKind;
  21. };
  22. /// \brief Handle a runtime type check failure, caused by an incorrect vptr.
  23. /// When this handler is called, all we know is that the type was not in the
  24. /// cache; this does not necessarily imply the existence of a bug.
  25. extern "C" SANITIZER_INTERFACE_ATTRIBUTE
  26. void __ubsan_handle_dynamic_type_cache_miss(
  27. DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
  28. extern "C" SANITIZER_INTERFACE_ATTRIBUTE
  29. void __ubsan_handle_dynamic_type_cache_miss_abort(
  30. DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
  31. }
  32. #endif // UBSAN_HANDLERS_H