/illumos-gate/usr/src/tools/smatch/src/ |
H A D | check_access_ok_math.c | 27 expr = strip_expr(expr); in can_overflow() 29 if (expr->type == EXPR_BINOP) { in can_overflow() 30 uncapped += can_overflow(expr->left); in can_overflow() 31 uncapped += can_overflow(expr->right); in can_overflow() 34 (expr->op == '+' || expr->op == '*' || expr->op == SPECIAL_LEFTSHIFT)) in can_overflow() 40 if (get_implied_max(expr, &max)) in can_overflow() 78 struct expression *expr; in split_asm_constraints() local 82 FOR_EACH_PTR(expr_list, expr) { in split_asm_constraints() 84 if (expr->type != EXPR_ASM_OPERAND) in split_asm_constraints() 87 match_size(expr->expr); in split_asm_constraints() [all …]
|
H A D | smatch.h | 432 int is_array(struct expression *expr); 480 int expr_signed(struct expression *expr); 482 int is_pointer(struct expression *expr); 486 int nr_bits(struct expression *expr); 489 int is_string(struct expression *expr); 491 int is_static(struct expression *expr); 501 int is_struct(struct expression *expr); 565 int inlinable(struct expression *expr); 601 int assume(struct expression *expr); 1072 int is_capped(struct expression *expr); [all …]
|
H A D | smatch_strlen.c | 65 if (expr->op != '=') in match_string_assignment() 80 right = strip_expr(expr->right); in match_strlen() 82 len_expr = strip_expr(expr->left); in match_strlen() 107 if (expr->type != EXPR_COMPARE) in match_strlen_condition() 110 left = strip_expr(expr->left); in match_strlen_condition() 111 right = strip_expr(expr->right); in match_strlen_condition() 127 op = expr->op; in match_strlen_condition() 228 len = expr->string->length; in get_strlen_from_string() 266 expr = strip_expr(expr); in get_implied_strlen() 267 if (expr->type == EXPR_STRING) in get_implied_strlen() [all …]
|
H A D | check_uninitialized.c | 114 if (expr->type != EXPR_COMPARE || expr->op != '<') in match_negative_comparison() 116 if (!expr_is_zero(expr->right)) in match_negative_comparison() 121 success = compare_expression(expr->left, SPECIAL_EQUAL, expr->right); in match_negative_comparison() 137 expr = strip_expr(expr); in is_initialized() 138 if (expr->type != EXPR_SYMBOL) in is_initialized() 155 if (expr->type != EXPR_PREOP) in match_dereferences() 179 if (is_initialized(expr)) in match_condition() 182 name = expr_to_str(expr); in match_condition() 309 if (is_initialized(expr)) in match_symbol() 312 if (is_being_modified(expr)) in match_symbol() [all …]
|
H A D | check_index_overflow.c | 95 if (!get_user_rl(expr, &rl)) in get_the_max() 98 is_capped(expr)) in get_the_max() 168 expr = strip_expr(expr); in is_subtract() 170 expr = strip_expr(tmp); in is_subtract() 175 if (expr->type == EXPR_BINOP && expr->op == '-') in is_subtract() 215 expr = strip_expr(expr); in should_warn() 216 if (!is_array(expr)) in should_warn() 276 if (!should_warn(expr)) in array_check() 279 expr = strip_expr(expr); in array_check() 293 if (!should_warn(expr)) { in array_check() [all …]
|
H A D | smatch_extra.c | 117 if (!expr || expr->type != EXPR_DEREF || !expr->member) in set_union_info() 370 expr = strip_expr(expr); in chunk_get_array_base() 372 expr = strip_expr(expr->deref); in chunk_get_array_base() 426 expr = strip_expr(expr); in set_extra_expr_mod() 585 expr = strip_expr(expr); in set_extra_expr_true_false() 1281 expr = strip_expr(expr); in clear_pointed_at_state() 1388 expr = strip_expr(expr->unop); in find_dereferences() 2199 expr = strip_expr(expr); in __extra_match_condition() 2235 expr = strip_expr(expr); in assume_indexes_are_valid() 2325 expr = strip_expr(expr); in parent_is_null() [all …]
|
H A D | check_resource_size.c | 23 static int is_probably_ok(struct expression *expr) in is_probably_ok() argument 25 expr = strip_expr(expr); in is_probably_ok() 27 if (expr->type == EXPR_BINOP) in is_probably_ok() 29 if (expr->type == EXPR_SIZEOF) in is_probably_ok() 35 static void verify_size_expr(struct expression *expr) in verify_size_expr() argument 37 if (expr->type != EXPR_BINOP) in verify_size_expr() 39 if (expr->op != '-') in verify_size_expr() 41 if (is_probably_ok(expr->left)) in verify_size_expr() 43 if (is_probably_ok(expr->right)) in verify_size_expr() 55 expr = (struct expression *)state->data; in handle_assigned_expr() [all …]
|
H A D | check_spectre_second_half.c | 36 name = expr_to_str(expr); in set_spectre_first_half() 57 name = expr_to_str(expr); in get_spectre_first_half() 68 if (expr->op == SPECIAL_AND_ASSIGN) in match_assign() 73 set_state_expr(my_id, expr->left, state); in match_assign() 74 recently_set = expr->left; in match_assign() 77 state = get_state_expr(my_id, expr->right); in match_assign() 80 set_state_expr(my_id, expr->left, state); in match_assign() 81 recently_set = expr->left; in match_assign() 89 if (expr == recently_set) in match_done() 92 state = get_state_expr(my_id, expr); in match_done() [all …]
|
H A D | check_free.c | 71 if (!is_freed(expr)) in match_symbol() 73 name = expr_to_var(expr); in match_symbol() 85 if (expr->type != EXPR_PREOP) in match_dereferences() 91 expr = strip_expr(expr->unop); in match_dereferences() 92 if (!is_freed(expr)) in match_dereferences() 94 name = expr_to_var(expr); in match_dereferences() 165 set_ignored_params(expr); in match_call() 196 if (!expr) in match_return() 198 if (!is_freed(expr)) in match_return() 201 name = expr_to_var(expr); in match_return() [all …]
|
H A D | check_testing_index_after_use.c | 38 static void array_check(struct expression *expr) in array_check() argument 45 expr = strip_expr(expr); in array_check() 46 if (!is_array(expr)) in array_check() 49 array_expr = get_array_base(expr); in array_check() 54 offset = get_array_offset(expr); in array_check() 58 if (buf_comparison_index_ok(expr)) in array_check() 61 if (getting_address(expr)) in array_check() 76 if (!expr || expr->type != EXPR_COMPARE) in match_condition() 78 if (get_macro_name(expr->pos)) in match_condition() 80 if (get_implied_value(expr->left, &sval)) in match_condition() [all …]
|
H A D | check_free_strict.c | 88 if (!is_freed(expr)) in match_symbol() 90 name = expr_to_var(expr); in match_symbol() 107 expr = strip_expr(expr->unop); in match_dereferences() 108 if (!is_freed(expr)) in match_dereferences() 110 name = expr_to_var(expr); in match_dereferences() 181 set_ignored_params(expr); in match_call() 210 if (!expr) in match_return() 212 if (!is_freed(expr)) in match_return() 215 name = expr_to_var(expr); in match_return() 248 expr = strip_expr(expr->right); in set_param_freed() [all …]
|
H A D | check_sizeof.c | 27 if (!expr || expr->type != EXPR_SIZEOF) in check_pointer() 30 get_value(expr, &sval); in check_pointer() 32 expr = strip_expr(expr->cast_expression); in check_pointer() 33 name = expr_to_str(expr); in check_pointer() 48 if (!is_pointer(expr->left)) in match_call_assignment() 51 ptr_name = expr_to_str(expr->left); in match_call_assignment() 102 if (expr->type != EXPR_VALUE) in check_sizeof_number() 115 check_sizeof_number(expr); in match_sizeof() 116 if (expr->type == EXPR_PREOP && expr->op == '&') in match_sizeof() 118 if (expr->type == EXPR_SIZEOF) in match_sizeof() [all …]
|
H A D | smatch_db.c | 846 expr = strip_expr(expr); in sm_to_arg_name() 851 expr = strip_expr(expr->unop); in sm_to_arg_name() 904 expr = strip_expr(expr); in print_struct_members() 912 expr = strip_expr(expr->unop); in print_struct_members() 1332 info.expr = expr; in match_return_implies() 1362 expr = strip_expr(expr); in get_fn_param_str() 1365 expr = strip_expr(expr->fn); in get_fn_param_str() 2083 expr = expr->unop; in strip_expr_statement() 2127 expr = strip_expr(expr); in call_return_state_hooks() 2589 expr = strip_expr(expr->right); in return_state_to_var_sym() [all …]
|
H A D | smatch_nul_terminator.c | 40 name = expr_to_var_sym(expr, &sym); in set_terminated() 53 if (expr->op != '=') in match_nul_assign() 94 if (!expr) in get_terminated_state() 96 if (expr->type == EXPR_STRING) in get_terminated_state() 116 if (expr->op != '=') in match_string_assign() 159 FOR_EACH_PTR(expr->args, arg) { in match_call_info() 238 arg = expr->left; in return_info_terminated() 240 struct expression *call = expr; in return_info_terminated() 280 if (expr->type != EXPR_COMPARE) in match_strnlen_test() 282 if (expr->op != SPECIAL_EQUAL && expr->op != SPECIAL_NOTEQUAL) in match_strnlen_test() [all …]
|
H A D | smatch_buf_comparison.c | 64 expr = sm->state->data; in match_link_modify() 65 if (expr) { in match_link_modify() 73 if (expr) in match_link_modify() 119 expr = strip_expr(expr); in alloc_compare_size() 124 state->data = expr; in alloc_compare_size() 132 type = get_type(expr); in bytes_per_element() 273 expr = strip_expr(expr); in array_check() 274 if (!is_array(expr)) in array_check() 426 expr = strip_expr(expr); in array_check_data_info() 494 left = expr->left; in match_size_binop() [all …]
|
H A D | smatch_assigned_expr.c | 44 state = get_state_expr(my_id, expr); in get_assigned_expr() 67 if (expr->op != '=') in match_assignment() 69 if (is_fake_call(expr->right)) in match_assignment() 74 if (!get_implied_rl(expr->right, &rl)) in match_assignment() 80 if (expr->left == ignored_expr) in match_assignment() 84 ignored_expr = expr->left; in match_assignment() 86 left_name = expr_to_var_sym(expr->left, &left_sym); in match_assignment() 110 while (expr->type == EXPR_ASSIGNMENT) in record_param_assignment() 111 expr = strip_expr(expr->right); in record_param_assignment() 112 if (!expr || expr->type != EXPR_CALL) in record_param_assignment() [all …]
|
H A D | check_check_deref.c | 56 expr = strip_expr(expr); in check_dereference() 63 if (implied_not_equal(expr, 0)) in check_dereference() 109 if (expr->type != EXPR_PREOP) in match_dereferences() 111 check_dereference(expr->unop); in match_dereferences() 116 if (!is_array(expr)) in match_pointer_as_array() 140 name = get_macro_name(expr->pos); in match_condition() 145 if (!is_pointer(expr)) in match_condition() 149 match_condition(expr->right); in match_condition() 150 match_condition(expr->left); in match_condition() 153 if (implied_not_equal(expr, 0)) in match_condition() [all …]
|
H A D | smatch_mtag_data.c | 93 if (expr->type != EXPR_DEREF) in is_head_next() 95 if (!expr->member || !expr->member->name || in is_head_next() 99 type = get_type(expr->deref); in is_head_next() 150 sym = expr_to_sym(expr); in parent_is_fresh_alloc() 164 if (!expr) in update_mtag_data() 168 if (is_ignored_macro(expr)) in update_mtag_data() 170 if (is_head_next(expr)) in update_mtag_data() 172 name = expr_to_var(expr); in update_mtag_data() 182 type = get_type(expr); in update_mtag_data() 201 if (is_ignored_macro(expr)) in match_global_assign() [all …]
|
H A D | check_rosenberg.c | 109 type = get_type(expr); in warn_on_holey_struct() 120 if (expr->type != EXPR_SYMBOL) in has_global_scope() 122 sym = expr->symbol; in has_global_scope() 202 sym = get_type(expr); in check_members_initialized() 288 expr = strip_expr(expr->right); in db_param_cleared() 289 if (expr->type != EXPR_CALL) in db_param_cleared() 300 name = expr_to_str(expr); in alloc_expr_state() 305 expr = strip_expr(expr); in alloc_expr_state() 308 state->data = expr; in alloc_expr_state() 317 type = get_type(expr->left); in match_skb_put() [all …]
|
H A D | check_off_by_one_relative.c | 38 expr = strip_expr(expr); in array_check() 39 if (!is_array(expr)) in array_check() 42 array = get_array_base(expr); in array_check() 46 offset = get_array_offset(expr); in array_check() 50 if (buf_comparison_index_ok(expr)) in array_check() 67 array = get_array_base(expr); in known_access_ok_numbers() 68 offset = get_array_offset(expr); in known_access_ok_numbers() 90 expr = strip_expr(expr); in array_check_data_info() 91 if (!is_array(expr)) in array_check_data_info() 99 array = get_array_base(expr); in array_check_data_info() [all …]
|
H A D | check_macro_side_effects.c | 33 expr = strip_expr(expr); in alloc_my_state() 34 name = expr_to_str(expr); in alloc_my_state() 41 state->data = expr; in alloc_my_state() 51 name = expr_to_var_sym(expr, &sym); in defined_inside_macro() 69 sm = get_sm_state_expr(my_id, expr); in affected_inside_macro_before() 96 struct expression *expr; in match_unop() local 106 expr = strip_expr(raw_expr->unop); in match_unop() 108 if (defined_inside_macro(expr->pos, expr)) in match_unop() 115 set_state_expr(my_id, expr, alloc_my_state(expr)); in match_unop() 116 old_pos = expr->pos; in match_unop() [all …]
|
H A D | check_unused_ret.c | 78 if (expr->type != EXPR_CALL) in get_fn_name() 80 if (expr->fn->type != EXPR_SYMBOL) in get_fn_name() 82 return expr_to_var(expr->fn); in get_fn_name() 90 func = get_fn_name(expr); in ignored_function() 108 if (expr->op != '=') in match_assign_call() 112 if (ignored_function(expr->right)) in match_assign_call() 114 left = strip_expr(expr->left); in match_assign_call() 136 if (expr->op != '=') in match_assign() 138 left = strip_expr(expr->left); in match_assign() 169 expr = strip_expr(expr); in match_symbol() [all …]
|
H A D | check_double_checking.c | 42 expr = strip_expr(expr); in strip_condition() 44 if (expr->type == EXPR_PREOP && expr->op == '!') in strip_condition() 47 if (expr->type == EXPR_COMPARE && in strip_condition() 48 (expr->op == SPECIAL_EQUAL || in strip_condition() 50 if (expr_is_zero(expr->left)) in strip_condition() 52 if (expr_is_zero(expr->right)) in strip_condition() 56 return expr; in strip_condition() 176 if (get_value(expr, &dummy)) in match_condition() 179 if (get_macro_name(expr->pos)) in match_condition() 192 if (is_pointer(expr) && implied_condition_true(expr)) in match_condition() [all …]
|
/illumos-gate/usr/src/ucbcmd/expr/ |
H A D | expr.y | 63 expr: '(' expr ')' = { $$ = $2; } 64 | expr OR expr = { $$ = conj(OR, $1, $3); } 66 | expr EQ expr = { $$ = rel(EQ, $1, $3); } 67 | expr GT expr = { $$ = rel(GT, $1, $3); } 68 | expr GEQ expr = { $$ = rel(GEQ, $1, $3); } 69 | expr LT expr = { $$ = rel(LT, $1, $3); } 70 | expr LEQ expr = { $$ = rel(LEQ, $1, $3); } 77 | expr MCH expr = { $$ = match($1, $3); } 78 | MATCH expr expr = { $$ = match($2, $3); } 79 | SUBSTR expr expr expr = { $$ = substr($2, $3, $4); } [all …]
|
/illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/ |
H A D | fsdb_yacc.y | 97 %type <intval> expr 351 | xfind ' ' expr 482 | ATMIC '=' expr 497 | CTMIC '=' expr 579 texpr : expr 584 | expr ',' expr 591 expr : '+' 672 | expr '-' expr { count = 0; $$ = $1 - $3; } 673 | expr '+' expr { count = 0; $$ = $1 + $3; } 674 | expr '*' expr { count = 0; $$ = $1 * $3; } [all …]
|