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
= {
40 static const sval_t array_max_sval
= {
42 {.value
= ULONG_MAX
- 4095},
44 static const sval_t text_seg_min
= {
48 static const sval_t text_seg_max
= {
50 {.value
= ULONG_MAX
- 4095},
52 static const sval_t data_seg_min
= {
56 static const sval_t data_seg_max
= {
58 {.value
= ULONG_MAX
- 4095},
60 static const sval_t bss_seg_min
= {
64 static const sval_t bss_seg_max
= {
66 {.value
= ULONG_MAX
- 4095},
68 static const sval_t stack_seg_min
= {
72 static const sval_t stack_seg_max
= {
74 {.value
= ULONG_MAX
- 4095},
76 static const sval_t kmalloc_seg_min
= {
80 static const sval_t kmalloc_seg_max
= {
82 {.value
= ULONG_MAX
- 4095},
84 static const sval_t vmalloc_seg_min
= {
88 static const sval_t vmalloc_seg_max
= {
90 {.value
= ULONG_MAX
- 4095},
92 static const sval_t fn_ptr_min
= {
96 static const sval_t fn_ptr_max
= {
98 {.value
= ULONG_MAX
- 4095},