atomic_dec_test_path: hack around assignments
[smatch.git] / smatch_constants.h
blob3b77ad0d5412b5e178f2e98b6e2effe830ee7c23
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 int_minus_one = { .type = &int_ctype, .value = -1 };
9 static const sval_t err_min = { .type = &int_ctype, .value = -4095 };
10 static const sval_t err_max = { .type = &int_ctype, .value = -1 };
11 static const sval_t int_max = { .type = &int_ctype, .value = INT_MAX };
13 static const sval_t bool_false = { .type = &bool_ctype, .value = 0 };
14 static const sval_t bool_true = { .type = &bool_ctype, .value = 1 };
16 extern sval_t ptr_err_min;
17 extern sval_t ptr_err_max;
18 static const sval_t ptr_null = { .type = &ptr_ctype, .value = 0 };
20 static const sval_t ulong_zero = { .type = &ulong_ctype, .value = 0 };
21 static const sval_t ulong_one = { .type = &ulong_ctype, .value = 1 };
22 static const sval_t ulong_INT_MAX = { .type = &ulong_ctype, .value = INT_MAX };
23 extern sval_t ulong_ULONG_MAX;
25 #define MTAG_ALIAS_BIT (1ULL << 63)
26 #define MTAG_OFFSET_MASK 0xfffULL
27 #define MTAG_SEED 0xdead << 12
29 const extern unsigned long valid_ptr_min;
30 extern unsigned long valid_ptr_max;
31 extern const sval_t valid_ptr_min_sval;
32 extern sval_t valid_ptr_max_sval;
33 extern struct range_list *valid_ptr_rl;
34 void alloc_ptr_constants(void);
36 static const sval_t array_min_sval = {
37 .type = &ptr_ctype,
38 {.value = 100000},
40 static const sval_t array_max_sval = {
41 .type = &ptr_ctype,
42 {.value = ULONG_MAX - 4095},
44 static const sval_t text_seg_min = {
45 .type = &ptr_ctype,
46 {.value = 4096},
48 static const sval_t text_seg_max = {
49 .type = &ptr_ctype,
50 {.value = ULONG_MAX - 4095},
52 static const sval_t data_seg_min = {
53 .type = &ptr_ctype,
54 {.value = 4096},
56 static const sval_t data_seg_max = {
57 .type = &ptr_ctype,
58 {.value = ULONG_MAX - 4095},
60 static const sval_t bss_seg_min = {
61 .type = &ptr_ctype,
62 {.value = 4096},
64 static const sval_t bss_seg_max = {
65 .type = &ptr_ctype,
66 {.value = ULONG_MAX - 4095},
68 static const sval_t stack_seg_min = {
69 .type = &ptr_ctype,
70 {.value = 4096},
72 static const sval_t stack_seg_max = {
73 .type = &ptr_ctype,
74 {.value = ULONG_MAX - 4095},
76 static const sval_t kmalloc_seg_min = {
77 .type = &ptr_ctype,
78 {.value = 4096},
80 static const sval_t kmalloc_seg_max = {
81 .type = &ptr_ctype,
82 {.value = ULONG_MAX - 4095},
84 static const sval_t vmalloc_seg_min = {
85 .type = &ptr_ctype,
86 {.value = 4096},
88 static const sval_t vmalloc_seg_max = {
89 .type = &ptr_ctype,
90 {.value = ULONG_MAX - 4095},
92 static const sval_t fn_ptr_min = {
93 .type = &ptr_ctype,
94 {.value = 4096},
96 static const sval_t fn_ptr_max = {
97 .type = &ptr_ctype,
98 {.value = ULONG_MAX - 4095},
101 #endif