mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Restore MODE=dbg support
We recently broke MODE=dbg support when we added C++ exception support. This change adds the missing UBSAN interfaces, needed to get it working again. Some of the ASAN checking in the SJLJ guts needed to be disabled since I doubt anyone's combined the two features until now.
This commit is contained in:
parent
f27808c4d2
commit
c1e18e7903
5 changed files with 34 additions and 38 deletions
|
@ -112,6 +112,13 @@ struct UbsanOverflowData {
|
|||
struct UbsanTypeDescriptor *type;
|
||||
};
|
||||
|
||||
struct UbsanDynamicTypeCacheMissData {
|
||||
struct UbsanSourceLocation location;
|
||||
struct UbsanTypeDescriptor *type;
|
||||
void *TypeInfo;
|
||||
unsigned char TypeCheckKind;
|
||||
};
|
||||
|
||||
struct UbsanFloatCastOverflowData {
|
||||
#if __GNUC__ + 0 >= 6
|
||||
struct UbsanSourceLocation location;
|
||||
|
@ -145,6 +152,8 @@ upcast of\0\
|
|||
cast to virtual base of\0\
|
||||
\0";
|
||||
|
||||
uintptr_t __ubsan_vptr_type_cache[128];
|
||||
|
||||
static int __ubsan_bits(struct UbsanTypeDescriptor *t) {
|
||||
return 1 << (t->info >> 1);
|
||||
}
|
||||
|
@ -439,15 +448,22 @@ void __ubsan_handle_divrem_overflow_abort(
|
|||
__ubsan_handle_divrem_overflow(loc);
|
||||
}
|
||||
|
||||
static bool HandleDynamicTypeCacheMiss(
|
||||
struct UbsanDynamicTypeCacheMissData *data, uintptr_t ptr, uintptr_t hash) {
|
||||
return false; // TODO: implement me
|
||||
}
|
||||
|
||||
void __ubsan_handle_dynamic_type_cache_miss(
|
||||
const struct UbsanSourceLocation *loc) {
|
||||
__ubsan_abort(loc, "dynamic type cache miss")();
|
||||
__ubsan_unreachable();
|
||||
struct UbsanDynamicTypeCacheMissData *data, uintptr_t ptr, uintptr_t hash) {
|
||||
HandleDynamicTypeCacheMiss(data, ptr, hash);
|
||||
}
|
||||
|
||||
void __ubsan_handle_dynamic_type_cache_miss_abort(
|
||||
const struct UbsanSourceLocation *loc) {
|
||||
__ubsan_handle_dynamic_type_cache_miss(loc);
|
||||
struct UbsanDynamicTypeCacheMissData *data, uintptr_t ptr, uintptr_t hash) {
|
||||
if (HandleDynamicTypeCacheMiss(data, ptr, hash)) {
|
||||
__ubsan_abort(&data->location, "dynamic type cache miss")();
|
||||
__ubsan_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
void __ubsan_handle_function_type_mismatch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue