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 ptr_err_min
= { .type
= &ptr_ctype
, .value
= -4095 };
13 static const sval_t ptr_err_max
= { .type
= &ptr_ctype
, .value
= -1 };
14 static const sval_t ptr_null
= { .type
= &ptr_ctype
, .value
= 0 };
16 static const sval_t ulong_one
= { .type
= &ulong_ctype
, .value
= 1 };
17 static const sval_t ulong_INT_MAX
= { .type
= &ulong_ctype
, .value
= INT_MAX
};
19 #define MTAG_ALIAS_BIT (1ULL << 63)
20 #define MTAG_OFFSET_MASK 0xfffULL
21 #define MTAG_SEED 0xdead << 12
23 const extern unsigned long valid_ptr_min
;
24 extern unsigned long valid_ptr_max
;
25 extern const sval_t valid_ptr_min_sval
;
26 extern sval_t valid_ptr_max_sval
;
27 extern struct range_list
*valid_ptr_rl
;
28 void alloc_valid_ptr_rl(void);
30 static const sval_t array_min_sval
= {
34 static const sval_t array_max_sval
= {
36 {.value
= ULONG_MAX
- 4095},
38 static const sval_t text_seg_min
= {
42 static const sval_t text_seg_max
= {
44 {.value
= ULONG_MAX
- 4095},
46 static const sval_t data_seg_min
= {
50 static const sval_t data_seg_max
= {
52 {.value
= ULONG_MAX
- 4095},
54 static const sval_t bss_seg_min
= {
58 static const sval_t bss_seg_max
= {
60 {.value
= ULONG_MAX
- 4095},
62 static const sval_t stack_seg_min
= {
66 static const sval_t stack_seg_max
= {
68 {.value
= ULONG_MAX
- 4095},
70 static const sval_t kmalloc_seg_min
= {
74 static const sval_t kmalloc_seg_max
= {
76 {.value
= ULONG_MAX
- 4095},
78 static const sval_t vmalloc_seg_min
= {
82 static const sval_t vmalloc_seg_max
= {
84 {.value
= ULONG_MAX
- 4095},
86 static const sval_t fn_ptr_min
= {
90 static const sval_t fn_ptr_max
= {
92 {.value
= ULONG_MAX
- 4095},