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_zero
= { .type
= &ulong_ctype
, .value
= 0 };
20 static const sval_t ulong_one
= { .type
= &ulong_ctype
, .value
= 1 };
21 static const sval_t ulong_INT_MAX
= { .type
= &ulong_ctype
, .value
= INT_MAX
};
22 static const sval_t ulong_ULONG_MAX
= { .type
= &ulong_ctype
, .uvalue
= ULONG_MAX
};
24 #define MTAG_ALIAS_BIT (1ULL << 63)
25 #define MTAG_OFFSET_MASK 0xfffULL
26 #define MTAG_SEED 0xdead << 12
28 const extern unsigned long valid_ptr_min
;
29 extern unsigned long valid_ptr_max
;
30 extern const sval_t valid_ptr_min_sval
;
31 extern sval_t valid_ptr_max_sval
;
32 extern struct range_list
*valid_ptr_rl
;
33 void alloc_valid_ptr_rl(void);
35 static const sval_t array_min_sval
= {
39 static const sval_t array_max_sval
= {
41 {.value
= ULONG_MAX
- 4095},
43 static const sval_t text_seg_min
= {
47 static const sval_t text_seg_max
= {
49 {.value
= ULONG_MAX
- 4095},
51 static const sval_t data_seg_min
= {
55 static const sval_t data_seg_max
= {
57 {.value
= ULONG_MAX
- 4095},
59 static const sval_t bss_seg_min
= {
63 static const sval_t bss_seg_max
= {
65 {.value
= ULONG_MAX
- 4095},
67 static const sval_t stack_seg_min
= {
71 static const sval_t stack_seg_max
= {
73 {.value
= ULONG_MAX
- 4095},
75 static const sval_t kmalloc_seg_min
= {
79 static const sval_t kmalloc_seg_max
= {
81 {.value
= ULONG_MAX
- 4095},
83 static const sval_t vmalloc_seg_min
= {
87 static const sval_t vmalloc_seg_max
= {
89 {.value
= ULONG_MAX
- 4095},
91 static const sval_t fn_ptr_min
= {
95 static const sval_t fn_ptr_max
= {
97 {.value
= ULONG_MAX
- 4095},