mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-04 09:14:04 +08:00
95710d75ec
So that we don't have to bump libubsan.so.1 SONAME, the following patch reverts part of the changes which removed two handlers. While we don't actually use them from GCC, we shouldn't remove supported entrypoints unless SONAME is changed (removal of __interceptor_* or ___interceptor_* is fine). This is the only removal, other libraries just added some symbols. 2023-11-15 Jakub Jelinek <jakub@redhat.com> * ubsan/ubsan_handlers_cxx.h (FunctionTypeMismatchData): Forward declare. (__ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): Declare. * ubsan/ubsan_handlers_cxx.cpp (handleFunctionTypeMismatch, __ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): New functions readded for backwards compatibility from older ubsan. * ubsan/ubsan_interface.inc (__ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): Readd.
52 lines
2.0 KiB
C++
52 lines
2.0 KiB
C++
//===-- ubsan_handlers_cxx.h ------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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);
|
|
|
|
struct FunctionTypeMismatchData;
|
|
|
|
extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
|
|
__ubsan_handle_function_type_mismatch_v1(FunctionTypeMismatchData *Data,
|
|
ValueHandle Val,
|
|
ValueHandle calleeRTTI,
|
|
ValueHandle fnRTTI);
|
|
extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
|
|
__ubsan_handle_function_type_mismatch_v1_abort(FunctionTypeMismatchData *Data,
|
|
ValueHandle Val,
|
|
ValueHandle calleeRTTI,
|
|
ValueHandle fnRTTI);
|
|
}
|
|
|
|
#endif // UBSAN_HANDLERS_CXX_H
|