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
= {
37 static const sval_t array_max_sval
= {
39 {.value
= ULONG_MAX
- 4095},
41 static const sval_t text_seg_min
= {
45 static const sval_t text_seg_max
= {
47 {.value
= ULONG_MAX
- 4095},
49 static const sval_t data_seg_min
= {
53 static const sval_t data_seg_max
= {
55 {.value
= ULONG_MAX
- 4095},
57 static const sval_t bss_seg_min
= {
61 static const sval_t bss_seg_max
= {
63 {.value
= ULONG_MAX
- 4095},
65 static const sval_t stack_seg_min
= {
69 static const sval_t stack_seg_max
= {
71 {.value
= ULONG_MAX
- 4095},
73 static const sval_t kmalloc_seg_min
= {
77 static const sval_t kmalloc_seg_max
= {
79 {.value
= ULONG_MAX
- 4095},
81 static const sval_t vmalloc_seg_min
= {
85 static const sval_t vmalloc_seg_max
= {
87 {.value
= ULONG_MAX
- 4095},
89 static const sval_t fn_ptr_min
= {
93 static const sval_t fn_ptr_max
= {
95 {.value
= ULONG_MAX
- 4095},