summaryrefslogtreecommitdiff
path: root/libsanitizer/ubsan/ubsan_handlers_cxx.h
diff options
context:
space:
mode:
authorMarek Polacek <mpolacek@gcc.gnu.org>2013-08-30 16:12:58 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2013-08-30 16:12:58 +0000
commitde5a5fa1395db2cb5da4d0593fef40ec22378576 (patch)
tree23d42aa647cb7a2de96792b724ecaaddee3423fa /libsanitizer/ubsan/ubsan_handlers_cxx.h
parentf07f30cfb5efe0806dedaea03b56c574da1b372c (diff)
downloadgcc-de5a5fa1395db2cb5da4d0593fef40ec22378576.tar.gz
Merge ubsan into trunk.
From-SVN: r202113
Diffstat (limited to 'libsanitizer/ubsan/ubsan_handlers_cxx.h')
-rw-r--r--libsanitizer/ubsan/ubsan_handlers_cxx.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libsanitizer/ubsan/ubsan_handlers_cxx.h b/libsanitizer/ubsan/ubsan_handlers_cxx.h
new file mode 100644
index 00000000000..3419744e390
--- /dev/null
+++ b/libsanitizer/ubsan/ubsan_handlers_cxx.h
@@ -0,0 +1,38 @@
+//===-- ubsan_handlers_cxx.h ------------------------------------*- C++ -*-===//
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Entry points to the runtime library for Clang's undefined behavior sanitizer,
+// for C++-specific checks. This code is not linked into C binaries.
+//
+//===----------------------------------------------------------------------===//
+#ifndef UBSAN_HANDLERS_CXX_H
+#define UBSAN_HANDLERS_CXX_H
+
+#include "ubsan_value.h"
+
+namespace __ubsan {
+
+struct DynamicTypeCacheMissData {
+ SourceLocation Loc;
+ const TypeDescriptor &Type;
+ void *TypeInfo;
+ unsigned char TypeCheckKind;
+};
+
+/// \brief Handle a runtime type check failure, caused by an incorrect vptr.
+/// When this handler is called, all we know is that the type was not in the
+/// cache; this does not necessarily imply the existence of a bug.
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE
+void __ubsan_handle_dynamic_type_cache_miss(
+ DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE
+void __ubsan_handle_dynamic_type_cache_miss_abort(
+ DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
+
+}
+
+#endif // UBSAN_HANDLERS_H