param_key: fix container of when no struct member is referenced
[smatch.git] / smatch_constants.h
blob2bd92ef1c09530d14620cb5eb9060ed79015dd6a
1 #include "expression.h"
3 #ifndef SMATCH_CONSTANTS_H_
4 #define SMATCH_CONSTANTS_H_
6 static const sval_t int_zero = { .type = &int_ctype, .value = 0 };
7 static const sval_t int_one = { .type = &int_ctype, .value = 1 };
8 static const sval_t err_min = { .type = &int_ctype, .value = -4095 };
9 static const sval_t err_max = { .type = &int_ctype, .value = -1 };
10 static const sval_t int_max = { .type = &int_ctype, .value = INT_MAX };
12 static const sval_t bool_false = { .type = &bool_ctype, .value = 0 };
13 static const sval_t bool_true = { .type = &bool_ctype, .value = 1 };
15 static const sval_t ptr_err_min = { .type = &ptr_ctype, .value = -4095 };
16 static const sval_t ptr_err_max = { .type = &ptr_ctype, .value = -1 };
17 static const sval_t ptr_null = { .type = &ptr_ctype, .value = 0 };
19 static const sval_t ulong_one = { .type = &ulong_ctype, .value = 1 };
20 static const sval_t ulong_INT_MAX = { .type = &ulong_ctype, .value = INT_MAX };
22 #define MTAG_ALIAS_BIT (1ULL << 63)
23 #define MTAG_OFFSET_MASK 0xfffULL
24 #define MTAG_SEED 0xdead << 12
26 const extern unsigned long valid_ptr_min;
27 extern unsigned long valid_ptr_max;
28 extern const sval_t valid_ptr_min_sval;
29 extern sval_t valid_ptr_max_sval;
30 extern struct range_list *valid_ptr_rl;
31 void alloc_valid_ptr_rl(void);
33 static const sval_t array_min_sval = {
34 .type = &ptr_ctype,
35 {.value = 100000},
37 static const sval_t array_max_sval = {
38 .type = &ptr_ctype,
39 {.value = ULONG_MAX - 4095},
41 static const sval_t text_seg_min = {
42 .type = &ptr_ctype,
43 {.value = 4096},
45 static const sval_t text_seg_max = {
46 .type = &ptr_ctype,
47 {.value = ULONG_MAX - 4095},
49 static const sval_t data_seg_min = {
50 .type = &ptr_ctype,
51 {.value = 4096},
53 static const sval_t data_seg_max = {
54 .type = &ptr_ctype,
55 {.value = ULONG_MAX - 4095},
57 static const sval_t bss_seg_min = {
58 .type = &ptr_ctype,
59 {.value = 4096},
61 static const sval_t bss_seg_max = {
62 .type = &ptr_ctype,
63 {.value = ULONG_MAX - 4095},
65 static const sval_t stack_seg_min = {
66 .type = &ptr_ctype,
67 {.value = 4096},
69 static const sval_t stack_seg_max = {
70 .type = &ptr_ctype,
71 {.value = ULONG_MAX - 4095},
73 static const sval_t kmalloc_seg_min = {
74 .type = &ptr_ctype,
75 {.value = 4096},
77 static const sval_t kmalloc_seg_max = {
78 .type = &ptr_ctype,
79 {.value = ULONG_MAX - 4095},
81 static const sval_t vmalloc_seg_min = {
82 .type = &ptr_ctype,
83 {.value = 4096},
85 static const sval_t vmalloc_seg_max = {
86 .type = &ptr_ctype,
87 {.value = ULONG_MAX - 4095},
89 static const sval_t fn_ptr_min = {
90 .type = &ptr_ctype,
91 {.value = 4096},
93 static const sval_t fn_ptr_max = {
94 .type = &ptr_ctype,
95 {.value = ULONG_MAX - 4095},
98 #endif