Merge tag '5.9-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6
[linux/fpc-iii.git] / lib / ubsan.h
blob7b56c09473a98e7fcff4c8e6640459d1d178c49c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LIB_UBSAN_H
3 #define _LIB_UBSAN_H
5 enum {
6 type_kind_int = 0,
7 type_kind_float = 1,
8 type_unknown = 0xffff
9 };
11 struct type_descriptor {
12 u16 type_kind;
13 u16 type_info;
14 char type_name[1];
17 struct source_location {
18 const char *file_name;
19 union {
20 unsigned long reported;
21 struct {
22 u32 line;
23 u32 column;
28 struct overflow_data {
29 struct source_location location;
30 struct type_descriptor *type;
33 struct type_mismatch_data {
34 struct source_location location;
35 struct type_descriptor *type;
36 unsigned long alignment;
37 unsigned char type_check_kind;
40 struct type_mismatch_data_v1 {
41 struct source_location location;
42 struct type_descriptor *type;
43 unsigned char log_alignment;
44 unsigned char type_check_kind;
47 struct type_mismatch_data_common {
48 struct source_location *location;
49 struct type_descriptor *type;
50 unsigned long alignment;
51 unsigned char type_check_kind;
54 struct nonnull_arg_data {
55 struct source_location location;
56 struct source_location attr_location;
57 int arg_index;
60 struct out_of_bounds_data {
61 struct source_location location;
62 struct type_descriptor *array_type;
63 struct type_descriptor *index_type;
66 struct shift_out_of_bounds_data {
67 struct source_location location;
68 struct type_descriptor *lhs_type;
69 struct type_descriptor *rhs_type;
72 struct unreachable_data {
73 struct source_location location;
76 struct invalid_value_data {
77 struct source_location location;
78 struct type_descriptor *type;
81 #if defined(CONFIG_ARCH_SUPPORTS_INT128)
82 typedef __int128 s_max;
83 typedef unsigned __int128 u_max;
84 #else
85 typedef s64 s_max;
86 typedef u64 u_max;
87 #endif
89 #endif