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 xa_err_min
= { .type
= &int_ctype
, .value
= (((-4095) << 2) | 2) };
12 static const sval_t xa_err_max
= { .type
= &int_ctype
, .value
= (((-1) << 2) | 2) };
13 static const sval_t int_max
= { .type
= &int_ctype
, .value
= INT_MAX
};
15 static const sval_t bool_false
= { .type
= &bool_ctype
, .value
= 0 };
16 static const sval_t bool_true
= { .type
= &bool_ctype
, .value
= 1 };
18 extern sval_t ptr_err_min
;
19 extern sval_t ptr_err_max
;
20 extern sval_t ptr_xa_err_min
;
21 extern sval_t ptr_xa_err_max
;
22 static const sval_t ptr_null
= { .type
= &ptr_ctype
, .value
= 0 };
24 static const sval_t ulong_zero
= { .type
= &ulong_ctype
, .value
= 0 };
25 static const sval_t ulong_one
= { .type
= &ulong_ctype
, .value
= 1 };
26 static const sval_t ulong_INT_MAX
= { .type
= &ulong_ctype
, .value
= INT_MAX
};
27 extern sval_t ulong_ULONG_MAX
;
29 #define MTAG_ALIAS_BIT (1ULL << 63)
30 #define MTAG_OFFSET_MASK 0xfffULL
31 #define MTAG_SEED 0xdead << 12
33 const extern unsigned long valid_ptr_min
;
34 extern unsigned long valid_ptr_max
;
35 extern const sval_t valid_ptr_min_sval
;
36 extern sval_t valid_ptr_max_sval
;
37 extern struct range_list
*valid_ptr_rl
;
38 void alloc_ptr_constants(void);
40 static const sval_t array_min_sval
= {
44 static const sval_t array_max_sval
= {
46 {.value
= ULONG_MAX
- 4095},
48 static const sval_t text_seg_min
= {
52 static const sval_t text_seg_max
= {
54 {.value
= ULONG_MAX
- 4095},
56 static const sval_t data_seg_min
= {
60 static const sval_t data_seg_max
= {
62 {.value
= ULONG_MAX
- 4095},
64 static const sval_t bss_seg_min
= {
68 static const sval_t bss_seg_max
= {
70 {.value
= ULONG_MAX
- 4095},
72 static const sval_t stack_seg_min
= {
76 static const sval_t stack_seg_max
= {
78 {.value
= ULONG_MAX
- 4095},
80 static const sval_t kmalloc_seg_min
= {
84 static const sval_t kmalloc_seg_max
= {
86 {.value
= ULONG_MAX
- 4095},
88 static const sval_t vmalloc_seg_min
= {
92 static const sval_t vmalloc_seg_max
= {
94 {.value
= ULONG_MAX
- 4095},
96 static const sval_t fn_ptr_min
= {
100 static const sval_t fn_ptr_max
= {
102 {.value
= ULONG_MAX
- 4095},