Searched refs:expr (Results 1 - 25 of 399) sorted by relevance

1234567891011>>

/illumos-gate/usr/src/tools/smatch/src/
H A Dcheck_precedence.c23 static int is_bool(struct expression *expr) argument
27 type = get_type(expr);
35 static int is_bool_from_context(struct expression *expr) argument
39 if (!get_implied_max(expr, &sval) || sval.uvalue > 1)
41 if (!get_implied_min(expr, &sval) || sval.value < 0)
46 static int is_bool_op(struct expression *expr) argument
48 expr = strip_expr(expr);
50 if (expr->type == EXPR_PREOP && expr
59 match_condition(struct expression *expr) argument
103 match_binop(struct expression *expr) argument
111 match_mask(struct expression *expr) argument
123 match_mask_compare(struct expression *expr) argument
133 match_subtract_shift(struct expression *expr) argument
[all...]
H A Dsmatch_expression_stacks.c21 void push_expression(struct expression_list **estack, struct expression *expr) argument
23 add_ptr_list(estack, expr);
28 struct expression *expr; local
30 expr = last_ptr_list((struct ptr_list *)*estack);
32 return expr;
37 struct expression *expr; local
39 expr = last_ptr_list((struct ptr_list *)estack);
40 return expr;
H A Dcheck_macros.c22 static void match_inside(struct expression *expr, struct position pos) argument
27 if (positions_eq(expr->pos, pos))
29 if (positions_eq(expr->unop->pos, pos))
39 static void match_one_side(struct expression *expr, struct position pos, int op) argument
44 if ((op == '+' || op == '*' || op == '|' || op == '&') && expr->op == op)
46 if (positions_eq(expr->right->pos, pos))
48 if (positions_eq(expr->left->pos, pos))
60 static void match_join(struct expression *expr) argument
62 if (expr->left->type == EXPR_PREOP)
63 match_inside(expr
[all...]
H A Dcheck_no_effect.c24 struct expression *expr; local
28 expr = stmt->expression;
29 if (!expr)
31 switch(expr->type) {
33 if (expr->op == '!')
35 if (expr->op == '~')
50 sm_warning("statement has no effect %d", expr->type);
H A Dcheck_select.c23 static void match_select(struct expression *expr) argument
25 if (expr->cond_true)
27 expr = strip_expr(expr->conditional);
28 if (expr->type != EXPR_COMPARE)
H A Dcheck_impossible_mask.c23 static unsigned long long find_possible_bits(struct expression *expr)
30 expr = strip_expr(expr);
32 if (get_implied_value(expr, &sval))
35 if (expr->type == EXPR_BINOP && (expr->op == '&' || expr->op == '|')) {
38 left = find_possible_bits(expr->left);
41 right = find_possible_bits(expr->right);
45 if (expr
64 get_possible_bits(struct expression *expr) argument
79 match_condition(struct expression *expr) argument
[all...]
H A Dcheck_access_ok_math.c22 static int can_overflow(struct expression *expr) argument
27 expr = strip_expr(expr);
29 if (expr->type == EXPR_BINOP) {
30 uncapped += can_overflow(expr->left);
31 uncapped += can_overflow(expr->right);
34 (expr->op == '+' || expr->op == '*' || expr->op == SPECIAL_LEFTSHIFT))
40 if (get_implied_max(expr,
68 match_access_ok(const char *fn, struct expression *expr, void *data) argument
78 struct expression *expr; local
[all...]
H A Dcheck_logical_instead_of_bitwise.c23 static int is_bitshift(struct expression *expr) argument
25 expr = strip_expr(expr);
27 if (expr->type != EXPR_BINOP)
29 if (expr->op == SPECIAL_LEFTSHIFT)
34 static void match_logic(struct expression *expr) argument
38 if (expr->type != EXPR_LOGICAL)
41 if (get_macro_name(expr->pos))
44 if (!get_value(expr->right, &sval)) {
45 if (!get_value(expr
55 match_assign(struct expression *expr) argument
[all...]
H A Dcheck_spectre.c23 extern void set_spectre_first_half(struct expression *expr);
27 static int is_write(struct expression *expr) argument
32 static int is_read(struct expression *expr) argument
37 if (is_write(expr))
40 last_parent = expr;
41 while ((parent = expr_get_parent_expr(expr))){
50 if (parent->right == expr)
52 if (parent->left == expr)
55 expr = parent;
65 static int is_harmless(struct expression *expr) argument
93 get_max_by_type(struct expression *expr) argument
126 get_mask(struct expression *expr) argument
152 array_check(struct expression *expr) argument
[all...]
H A Dsmatch_recurse.c22 static int recurse(struct expression *expr, argument
23 int (func)(struct expression *expr, void *p),
28 if (!expr)
31 ret = func(expr, param);
39 switch (expr->type) {
41 ret = recurse(expr->unop, func, param, nr);
44 ret = recurse(expr->unop, func, param, nr);
53 ret = recurse(expr->left, func, param, nr);
56 ret = recurse(expr->right, func, param, nr);
59 ret = recurse(expr
114 has_symbol_helper(struct expression *expr, void *_sym) argument
125 has_symbol(struct expression *expr, struct symbol *sym) argument
131 struct expression *expr; member in struct:expr_name_sym
136 has_var_helper(struct expression *expr, void *_var) argument
161 has_variable(struct expression *expr, struct expression *var) argument
176 has_inc_dec_helper(struct expression *expr, void *unused) argument
187 has_inc_dec(struct expression *expr) argument
[all...]
H A Dcheck_cast_assign.c24 static struct symbol *get_cast_type(struct expression *expr) argument
26 if (!expr || expr->type != EXPR_PREOP || expr->op != '*')
28 expr = strip_parens(expr->unop);
29 if (expr->type != EXPR_CAST)
31 return get_pointer_type(expr);
34 static void match_overflow(struct expression *expr) argument
41 type = get_cast_type(expr
[all...]
H A Dsmatch_helper.c106 struct smatch_state *alloc_state_expr(struct expression *expr) argument
111 expr = strip_expr(expr);
112 name = expr_to_str(expr);
119 state->data = expr;
130 * get_argument_from_call_expr(expr, 0) to return the expression for
136 struct expression *expr; local
142 FOR_EACH_PTR(args, expr) {
144 return expr;
146 } END_FOR_EACH_PTR(expr);
150 get_array_expr(struct expression *expr) argument
175 __get_variable_from_expr(struct symbol **sym_ptr, char *buf, struct expression *expr, int len, int *complicated) argument
382 struct expression *expr; member in struct:expr_str_cache_results
388 get_variable_from_expr(struct symbol **sym_ptr, char *buf, struct expression *expr, int len, int *complicated) argument
431 expr_to_str_sym(struct expression *expr, struct symbol **sym_ptr) argument
450 expr_to_str(struct expression *expr) argument
460 expr_to_var_sym(struct expression *expr, struct symbol **sym_ptr) argument
484 expr_to_var(struct expression *expr) argument
489 expr_to_sym(struct expression *expr) argument
499 get_complication_score(struct expression *expr) argument
535 reorder_expr_alphabetically(struct expression *expr) argument
561 expr_to_chunk_helper(struct expression *expr, struct symbol **sym, struct var_sym_list **vsl) argument
611 expr_to_known_chunk_sym(struct expression *expr, struct symbol **sym) argument
616 expr_to_chunk_sym_vsl(struct expression *expr, struct symbol **sym, struct var_sym_list **vsl) argument
621 sym_name_is(const char *name, struct expression *expr) argument
632 expr_is_zero(struct expression *expr) argument
641 is_array(struct expression *expr) argument
667 get_array_base(struct expression *expr) argument
679 get_array_offset(struct expression *expr) argument
698 get_expression_statement(struct expression *expr) argument
715 strip_parens(struct expression *expr) argument
733 strip_expr_helper(struct expression *expr, bool set_parent) argument
806 strip_expr(struct expression *expr) argument
811 strip_expr_set_parent(struct expression *expr) argument
830 is_error_return(struct expression *expr) argument
861 getting_address(struct expression *expr) argument
878 get_struct_and_member(struct expression *expr, const char **type, const char **member) argument
901 get_member_name(struct expression *expr) argument
1035 get_last_expr_from_expression_stmt(struct expression *expr) argument
1094 get_param_num(struct expression *expr) argument
1146 parent_is_gone(struct expression *expr) argument
[all...]
H A Dcheck_resource_size.c23 static int is_probably_ok(struct expression *expr) argument
25 expr = strip_expr(expr);
27 if (expr->type == EXPR_BINOP)
29 if (expr->type == EXPR_SIZEOF)
35 static void verify_size_expr(struct expression *expr) argument
37 if (expr->type != EXPR_BINOP)
39 if (expr->op != '-')
41 if (is_probably_ok(expr->left))
43 if (is_probably_ok(expr
48 handle_assigned_expr(struct expression *expr) argument
59 match_resource(const char *fn, struct expression *expr, void *_arg_no) argument
[all...]
H A Dsmatch_strings.c61 static void match_strcpy(const char *fn, struct expression *expr, void *unused) argument
65 dest = get_argument_from_call_expr(expr->args, 0);
66 src = get_argument_from_call_expr(expr->args, 1);
72 struct state_list *get_strings(struct expression *expr) argument
78 expr = strip_expr(expr);
79 if (expr->type == EXPR_STRING) {
80 state = alloc_state_str(expr->string->data);
81 sm = alloc_sm_state(my_id, expr->string->data, NULL, state);
86 if (expr
110 match_assignment(struct expression *expr) argument
129 match_string(struct expression *expr) argument
[all...]
H A Dcheck_memset.c22 static void check_size_not_zero(struct expression *expr) argument
26 if (expr->type != EXPR_VALUE)
28 if (!get_value(expr, &sval))
35 static void check_size_not_ARRAY_SIZE(struct expression *expr) argument
39 name = get_macro_name(expr->pos);
44 static void match_memset(const char *fn, struct expression *expr, void *data) argument
48 arg_expr = get_argument_from_call_expr(expr->args, 2);
H A Dcheck_assign_vs_compare.c22 static void check_constant(struct expression *expr) argument
26 if (!get_value(expr->right, &val))
31 static void check_address(struct expression *expr) argument
34 struct expression *right = strip_expr(expr->right);
43 if (get_macro_name(expr->pos))
51 static void match_condition(struct expression *expr) argument
53 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=')
56 check_constant(expr);
57 check_address(expr);
[all...]
H A Dcheck_or_vs_and.c25 static int does_inc_dec(struct expression *expr) argument
27 if (expr->type == EXPR_PREOP || expr->type == EXPR_POSTOP) {
28 if (expr->op == SPECIAL_INCREMENT || expr->op == SPECIAL_DECREMENT)
30 return does_inc_dec(expr->unop);
64 static void check_or(struct expression *expr) argument
68 left = strip_expr(expr->left);
69 right = strip_expr(expr->right);
81 static int is_kernel_min_macro(struct expression *expr) argument
98 check_and(struct expression *expr) argument
118 match_logic(struct expression *expr) argument
129 is_unconstant_macro(struct expression *expr) argument
141 match_condition(struct expression *expr) argument
166 match_binop(struct expression *expr) argument
[all...]
H A Dcheck_array_condition.c30 static void match_condition(struct expression *expr) argument
35 if (expr->type != EXPR_DEREF)
37 type = get_type(expr);
40 if (get_macro_name(expr->pos))
43 str = expr_to_str(expr);
H A Dcheck_pointer_math.c30 static int is_sizeof(struct expression *expr) argument
32 return (expr->type == EXPR_SIZEOF);
35 static int is_macro(struct expression *expr, const char *macro_name) argument
42 if (outside_expr && positions_eq(expr->pos, outside_expr->pos))
45 name = get_macro_name(expr->pos);
51 static int is_size_in_bytes(struct expression *expr) argument
53 if (is_sizeof(expr))
56 if (is_macro(expr, "offsetof"))
58 if (is_macro(expr, "PAGE_SIZE"))
61 if (get_state_expr(my_id, expr)
67 match_binop(struct expression *expr) argument
99 match_assign(struct expression *expr) argument
109 check_assign(struct expression *expr) argument
[all...]
H A Dcheck_spectre_second_half.c31 void set_spectre_first_half(struct expression *expr) argument
36 name = expr_to_str(expr);
37 snprintf(buf, sizeof(buf), "%p %s", expr, name);
52 static struct smatch_state *get_spectre_first_half(struct expression *expr) argument
57 name = expr_to_str(expr);
58 snprintf(buf, sizeof(buf), "%p %s", expr, name);
64 static void match_assign(struct expression *expr) argument
68 if (expr->op == SPECIAL_AND_ASSIGN)
71 state = get_spectre_first_half(expr->right);
73 set_state_expr(my_id, expr
84 match_done(struct expression *expr) argument
[all...]
H A Dsmatch_conditions.c66 static void split_conditions(struct expression *expr);
68 static int is_logical_and(struct expression *expr) argument
70 if (expr->op == SPECIAL_LOGICAL_AND)
75 static int handle_zero_comparisons(struct expression *expr) argument
81 if (expr_is_zero(expr->left)) {
82 zero = strip_expr(expr->left);
84 __split_expr(expr->left);
85 tmp = expr->right;
86 } else if (expr_is_zero(expr->right)) {
87 zero = strip_expr(expr
115 ignore_builtin_expect(struct expression *expr) argument
130 struct expression *expr = NULL; local
156 handle_preop(struct expression *expr) argument
173 handle_logical(struct expression *expr) argument
234 handle_select(struct expression *expr) argument
357 handle_comma(struct expression *expr) argument
378 hackup_unsigned_compares(struct expression *expr) argument
387 do_condition(struct expression *expr) argument
395 split_conditions(struct expression *expr) argument
499 __split_whole_condition(struct expression *expr) argument
516 __handle_logic(struct expression *expr) argument
535 is_condition(struct expression *expr) argument
553 __handle_condition_assigns(struct expression *expr) argument
613 is_select_assign(struct expression *expr) argument
627 __handle_select_assigns(struct expression *expr) argument
704 __handle_expr_statement_assigns(struct expression *expr) argument
[all...]
H A Dsmatch_expressions.c5 __ALLOCATOR(struct expression, "temporary expr", tmp_expression);
11 struct expression *expr; local
14 expr = last_ptr_list((struct ptr_list *)big_expression_stack);
16 if (expr)
17 pos = expr->pos;
27 struct expression *expr; local
29 expr = __alloc_tmp_expression(0);
30 expr->smatch_flags |= Tmp;
31 expr->type = type;
32 expr
53 struct expression *expr; local
66 struct expression *expr; local
76 preop_expression(struct expression *expr, int op) argument
86 deref_expression(struct expression *expr) argument
95 struct expression *expr; local
110 struct expression *expr; local
121 struct expression *expr; local
129 struct expression *expr; local
139 struct expression *expr; local
169 struct expression *expr; local
299 expr_set_parent_expr(struct expression *expr, struct expression *parent) argument
309 expr_set_parent_stmt(struct expression *expr, struct statement *parent) argument
316 expr_get_parent_expr(struct expression *expr) argument
325 expr_get_parent_stmt(struct expression *expr) argument
[all...]
/illumos-gate/usr/src/cmd/vi/port/
H A Dinc.flg28 echo_file usr/src/cmd/expr/compile.c
/illumos-gate/usr/src/cmd/nl/
H A Dinc.flg29 echo_file usr/src/cmd/expr/compile.c
30 echo_file usr/src/cmd/expr/mapfile-intf
/illumos-gate/usr/src/cmd/ed/
H A Dinc.flg28 echo_file usr/src/cmd/expr/compile.c
29 echo_file usr/src/cmd/expr/mapfile-intf

Completed in 73 milliseconds

1234567891011>>