SayoriOS 0.3.3

ubsan.h
1 //
2 // Created by ndraey on 23.09.23.
3 //
4
5 #pragma once
6
7 #include "common.h"
8
9 #define is_aligned(value, alignment) !((value) & ((alignment) - 1))
10
11 struct source_location {
12 const char *file;
13 uint32_t line;
14 uint32_t column;
15 };
16
17 struct type_descriptor {
18 uint16_t kind;
19 uint16_t info;
20 char name[];
21 };
22
23 struct type_mismatch_info {
24 struct source_location location;
25 struct type_descriptor *type;
26 size_t alignment;
27 uint8_t type_check_kind;
28 };
29
30 struct out_of_bounds_info {
31 struct source_location location;
32 struct type_descriptor left_type;
33 // struct type_descriptor right_type;
34 };
35
36 static const char *Type_Check_Kinds[] = {
37 "load of",
38 "store to",
39 "reference binding to",
40 "member access within",
41 "member call on",
42 "constructor call on",
43 "downcast of",
44 "downcast of",
45 "upcast of",
46 "cast to virtual base of",
47 };
common.h
Основные определения ядра
out_of_bounds_info
Definition: ubsan.h:30
source_location
Definition: ubsan.h:11
type_descriptor
Definition: ubsan.h:17
type_mismatch_info
Definition: ubsan.h:23