Back to home page

LXR

 
 

    


0001 #ifndef _LIB_UBSAN_H
0002 #define _LIB_UBSAN_H
0003 
0004 enum {
0005     type_kind_int = 0,
0006     type_kind_float = 1,
0007     type_unknown = 0xffff
0008 };
0009 
0010 struct type_descriptor {
0011     u16 type_kind;
0012     u16 type_info;
0013     char type_name[1];
0014 };
0015 
0016 struct source_location {
0017     const char *file_name;
0018     union {
0019         unsigned long reported;
0020         struct {
0021             u32 line;
0022             u32 column;
0023         };
0024     };
0025 };
0026 
0027 struct overflow_data {
0028     struct source_location location;
0029     struct type_descriptor *type;
0030 };
0031 
0032 struct type_mismatch_data {
0033     struct source_location location;
0034     struct type_descriptor *type;
0035     unsigned long alignment;
0036     unsigned char type_check_kind;
0037 };
0038 
0039 struct nonnull_arg_data {
0040     struct source_location location;
0041     struct source_location attr_location;
0042     int arg_index;
0043 };
0044 
0045 struct nonnull_return_data {
0046     struct source_location location;
0047     struct source_location attr_location;
0048 };
0049 
0050 struct vla_bound_data {
0051     struct source_location location;
0052     struct type_descriptor *type;
0053 };
0054 
0055 struct out_of_bounds_data {
0056     struct source_location location;
0057     struct type_descriptor *array_type;
0058     struct type_descriptor *index_type;
0059 };
0060 
0061 struct shift_out_of_bounds_data {
0062     struct source_location location;
0063     struct type_descriptor *lhs_type;
0064     struct type_descriptor *rhs_type;
0065 };
0066 
0067 struct unreachable_data {
0068     struct source_location location;
0069 };
0070 
0071 struct invalid_value_data {
0072     struct source_location location;
0073     struct type_descriptor *type;
0074 };
0075 
0076 #if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)
0077 typedef __int128 s_max;
0078 typedef unsigned __int128 u_max;
0079 #else
0080 typedef s64 s_max;
0081 typedef u64 u_max;
0082 #endif
0083 
0084 #endif