summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ubsan.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/ubsan.c b/src/lib/ubsan.c
index 8c1f64d427..6873f7e238 100644
--- a/src/lib/ubsan.c
+++ b/src/lib/ubsan.c
@@ -68,7 +68,7 @@ struct ubsan_type_mismatch_data {
unsigned char type_check_kind;
};
-void __ubsan_handle_type_mismatch(void *data_raw, void *pointer_raw)
+void __ubsan_handle_type_mismatch_v1(void *data_raw, void *pointer_raw)
{
const struct ubsan_type_mismatch_data *data =
(struct ubsan_type_mismatch_data *)data_raw;
@@ -81,7 +81,7 @@ void __ubsan_handle_type_mismatch(void *data_raw, void *pointer_raw)
ubsan_abort(&data->location, violation);
}
-ABORT_VARIANT_VP_VP(type_mismatch);
+ABORT_VARIANT_VP_VP(type_mismatch_v1);
struct ubsan_overflow_data {
struct ubsan_source_location location;
@@ -156,6 +156,23 @@ void __ubsan_handle_divrem_overflow(void *data_raw, void *lhs_raw,
ABORT_VARIANT_VP_VP_VP(divrem_overflow);
+struct ubsan_pointer_overflow_data {
+ struct ubsan_source_location location;
+};
+
+void __ubsan_handle_pointer_overflow(void *data_raw, void *base_raw, void *result_raw)
+{
+ const struct ubsan_pointer_overflow_data *data =
+ (struct ubsan_pointer_overflow_data *)data_raw;
+ ubsan_value_handle_t base = (ubsan_value_handle_t)base_raw;
+ ubsan_value_handle_t result = (ubsan_value_handle_t)result_raw;
+ (void)base;
+ (void)result;
+ ubsan_abort(&data->location, "pointer overflow");
+}
+
+ABORT_VARIANT_VP_VP_VP(pointer_overflow);
+
struct ubsan_shift_out_of_bounds_data {
struct ubsan_source_location location;
struct ubsan_type_descriptor *lhs_type;