/illumos-gate/usr/src/tools/smatch/src/ |
H A D | check_deref_check.c | 30 static void match_dereference(struct expression *expr) in match_dereference() argument 35 if (expr->type != EXPR_PREOP) in match_dereference() 37 expr = strip_expr(expr->unop); in match_dereference() 38 if (!is_pointer(expr)) in match_dereference() 40 if (implied_not_equal(expr, 0)) in match_dereference() 46 set_state_expr(my_id, expr, &derefed); in match_dereference() 66 static void match_condition(struct expression *expr) in match_condition() argument 74 name = get_macro_name(expr->pos); in match_condition() 79 if (!is_pointer(expr)) in match_condition() 82 sm = get_sm_state_expr(my_id, expr); in match_condition() [all …]
|
H A D | check_signed_integer_overflow_check.c | 29 static void match_condition(struct expression *expr) in match_condition() argument 36 if (expr->type != EXPR_COMPARE) in match_condition() 38 if (expr->op != '<') in match_condition() 41 type = get_type(expr); in match_condition() 45 left = strip_expr(expr->left); in match_condition() 46 right = strip_expr(expr->right); in match_condition() 67 static void match_binop(struct expression *expr) in match_binop() argument 72 if (expr->op != '-') in match_binop() 75 if (!get_value(expr->left, &left_val)) in match_binop() 90 get_absolute_min(expr->right, &right_min); in match_binop() [all …]
|
H A D | check_assign_vs_compare.c | 22 static void check_constant(struct expression *expr) in check_constant() argument 26 if (!get_value(expr->right, &val)) in check_constant() 31 static void check_address(struct expression *expr) in check_address() argument 34 struct expression *right = strip_expr(expr->right); in check_address() 43 if (get_macro_name(expr->pos)) in check_address() 51 static void match_condition(struct expression *expr) in match_condition() argument 53 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=') in match_condition() 56 check_constant(expr); in match_condition() 57 check_address(expr); in match_condition()
|
H A D | check_implicit_dependencies_tester.c | 98 static void print_member_type(struct expression *expr) in print_member_type() argument 102 member = get_member_name(expr); in print_member_type() 111 static void match_condition(struct expression *expr) { in match_condition() argument 137 if (expr->type == EXPR_COMPARE || expr->type == EXPR_BINOP in match_condition() 138 || expr->type == EXPR_LOGICAL in match_condition() 139 || expr->type == EXPR_ASSIGNMENT in match_condition() 140 || expr->type == EXPR_COMMA) { in match_condition() 141 match_condition(expr->left); in match_condition() 142 match_condition(expr->right); in match_condition() 145 print_member_type(expr); in match_condition() [all …]
|
H A D | check_err_ptr_deref.c | 45 static void check_is_err_ptr(struct expression *expr) in check_is_err_ptr() argument 50 sm = get_sm_state_expr(my_id, expr); in check_is_err_ptr() 57 get_absolute_rl(expr, &rl); in check_is_err_ptr() 68 set_state_expr(my_id, expr->left, &err_ptr); in match_returns_err_ptr() 126 if (expr->type != EXPR_PREOP) in match_dereferences() 128 check_is_err_ptr(expr->unop); in match_dereferences() 142 if (expr->type == EXPR_ASSIGNMENT) { in match_condition() 143 match_condition(expr->right); in match_condition() 144 match_condition(expr->left); in match_condition() 146 if (!get_state_expr(my_id, expr)) in match_condition() [all …]
|
H A D | check_nospec.c | 40 bool is_nospec(struct expression *expr) in is_nospec() argument 46 if (!expr) in is_nospec() 48 if (get_state_expr(my_id, expr) == &nospec) in is_nospec() 50 macro = get_macro_name(expr->pos); in is_nospec() 56 static void nospec_assign(struct expression *expr) in nospec_assign() argument 58 if (is_nospec(expr->right)) in nospec_assign() 59 set_state_expr(my_id, expr->left, &nospec); in nospec_assign() 81 FOR_EACH_PTR(expr->args, arg) { in match_call_info() 106 returned_sym = expr_to_sym(expr); in returned_struct_members() 130 if (is_nospec(expr) && get_user_rl(expr, &rl)) in returned_struct_members() [all …]
|
H A D | smatch_data_source.c | 24 static char *get_source_parameter(struct expression *expr) in get_source_parameter() argument 36 tmp = expr; in get_source_parameter() 38 expr = tmp; in get_source_parameter() 43 expr = strip_expr(expr); in get_source_parameter() 44 if (expr->type != EXPR_SYMBOL) in get_source_parameter() 47 name = expr_to_var_sym(expr, &sym); in get_source_parameter() 68 static char *get_source_assignment(struct expression *expr) in get_source_assignment() argument 75 right = get_assigned_expr(expr); in get_source_assignment() 102 static void match_caller_info(struct expression *expr) in match_caller_info() argument 109 FOR_EACH_PTR(expr->args, arg) { in match_caller_info() [all …]
|
H A D | smatch_real_absolute.c | 41 set_state_expr(my_id, expr, clone_estate(state)); in set_real_absolute() 98 static void match_assign(struct expression *expr) in match_assign() argument 104 if (expr->op != '=') in match_assign() 106 if (is_fake_call(expr->right)) in match_assign() 111 get_real_absolute_rl(expr->right, &rl); in match_assign() 113 type = get_type(expr->left); in match_assign() 121 if (is_whole_rl(rl) && !get_state_expr(my_id, expr->left)) in match_assign() 124 if (rl_to_sval(rl, &sval) && !get_state_expr(my_id, expr->left)) in match_assign() 127 set_state_expr(my_id, expr->left, alloc_estate_rl(clone_rl(rl))); in match_assign() 130 struct smatch_state *get_real_absolute_state(struct expression *expr) in get_real_absolute_state() argument [all …]
|
H A D | check_kmalloc_to_bugon.c | 24 static int is_kmalloc_call(struct expression *expr) in is_kmalloc_call() argument 26 if (expr->type != EXPR_CALL) in is_kmalloc_call() 28 if (expr->fn->type != EXPR_SYMBOL) in is_kmalloc_call() 30 if (!strcmp(expr->fn->symbol_name->name, "kmalloc")) in is_kmalloc_call() 32 if (!strcmp(expr->fn->symbol_name->name, "kzalloc")) in is_kmalloc_call() 37 static void match_condition(struct expression *expr) in match_condition() argument 44 macro = get_macro_name(expr->pos); in match_condition() 47 state = get_state_expr(check_assigned_expr_id, expr); in match_condition() 54 name = expr_to_var(expr); in match_condition()
|
H A D | smatch_var_sym.c | 39 expr = strip_expr(expr); in expr_to_vsl() 40 if (!expr) in expr_to_vsl() 43 if ((expr->type == EXPR_PREOP && expr->op == '*')) { in expr_to_vsl() 44 unop = strip_expr(expr->unop); in expr_to_vsl() 51 if (expr->type == EXPR_BINOP || in expr_to_vsl() 52 expr->type == EXPR_LOGICAL || in expr_to_vsl() 53 expr->type == EXPR_COMPARE) { in expr_to_vsl() 56 left = expr_to_vsl(expr->left); in expr_to_vsl() 57 right = expr_to_vsl(expr->right); in expr_to_vsl() 64 if (expr->type == EXPR_DEREF) in expr_to_vsl() [all …]
|
H A D | check_kunmap.c | 28 struct expression *expr = (struct expression *)data; in check_assignment() local 31 if (!expr) in check_assignment() 33 if (expr->type != EXPR_CALL) in check_assignment() 35 fn = expr_to_var(expr->fn); in check_assignment() 43 static void match_kmap_atomic(const char *fn, struct expression *expr, void *data) in match_kmap_atomic() argument 47 arg = get_argument_from_call_expr(expr->args, 0); in match_kmap_atomic() 51 static void match_kunmap_atomic(const char *fn, struct expression *expr, void *data) in match_kunmap_atomic() argument 56 arg = get_argument_from_call_expr(expr->args, 0); in match_kunmap_atomic() 64 static void match_kunmap(const char *fn, struct expression *expr, void *data) in match_kunmap() argument 70 arg = get_argument_from_call_expr(expr->args, 0); in match_kunmap()
|
H A D | smatch_expression_stacks.c | 21 void push_expression(struct expression_list **estack, struct expression *expr) in push_expression() argument 23 add_ptr_list(estack, expr); in push_expression() 28 struct expression *expr; in pop_expression() local 30 expr = last_ptr_list((struct ptr_list *)*estack); in pop_expression() 32 return expr; in pop_expression() 37 struct expression *expr; in top_expression() local 39 expr = last_ptr_list((struct ptr_list *)estack); in top_expression() 40 return expr; in top_expression()
|
H A D | check_zero_to_err_ptr.c | 24 static int is_comparison_call(struct expression *expr) in is_comparison_call() argument 26 expr = expr_get_parent_expr(expr); in is_comparison_call() 27 if (!expr || expr->type != EXPR_COMPARE) in is_comparison_call() 29 if (expr->op != SPECIAL_EQUAL && expr->op != SPECIAL_NOTEQUAL) in is_comparison_call() 34 static int next_line_is_if(struct expression *expr) in next_line_is_if() argument 44 if (expr_equiv(expr, next)) in next_line_is_if() 122 static void match_err_ptr(const char *fn, struct expression *expr, void *data) in match_err_ptr() argument 130 arg_expr = get_argument_from_call_expr(expr->args, 0); in match_err_ptr() 135 if (is_comparison_call(expr)) in match_err_ptr() 138 if (next_line_checks_IS_ERR(expr, arg_expr)) in match_err_ptr()
|
H A D | check_wine_filehandles.c | 53 static void match_returns_handle(const char *fn, struct expression *expr, in match_returns_handle() argument 59 left_name = expr_to_var_sym(expr->left, &left_sym); in match_returns_handle() 62 set_state_expr(my_id, expr->left, &filehandle); in match_returns_handle() 67 static void match_condition(struct expression *expr) in match_condition() argument 69 if (expr->type == EXPR_ASSIGNMENT) in match_condition() 70 match_condition(expr->left); in match_condition() 72 if (get_state_expr(my_id, expr) == &filehandle) { in match_condition() 75 name = expr_to_var(expr); in match_condition() 77 set_state_expr(my_id, expr, &oktocheck); in match_condition()
|
H A D | smatch_implied.c | 691 expr = strip_parens(expr); in get_left_most_expr() 694 return expr; in get_left_most_expr() 702 if (get_value(expr, &dummy)) in is_merged_expr() 739 int comparison = expr->op; in handle_comparison() 757 type = get_type(expr); in handle_comparison() 789 expr = strip_expr(expr->unop); in handle_zero_comparison() 795 expr = expr->left; in handle_zero_comparison() 982 name = expr_to_str(expr); in set_implied_states() 1028 orig_expr = expr; in param_limit_implications() 1030 expr = strip_expr(expr->right); in param_limit_implications() [all …]
|
H A D | smatch_passes_array_size.c | 21 static int find_param_eq(struct expression *expr, int size) in find_param_eq() argument 28 FOR_EACH_PTR(expr->args, arg) { in find_param_eq() 39 static void match_call(struct expression *expr) in match_call() argument 53 FOR_EACH_PTR(expr->args, arg) { in match_call() 58 arg_type = get_arg_type(expr->fn, i); in match_call() 64 nr = find_param_eq(expr, size); in match_call() 67 sql_insert_caller_info(expr, ELEM_COUNT, i, buf, elem_count); in match_call() 73 nr = find_param_eq(expr, bytes); in match_call() 76 sql_insert_caller_info(expr, BYTE_COUNT, i, buf, byte_count); in match_call()
|
H A D | check_return_enomem.c | 30 struct expression *expr; in match_return() local 51 expr = get_assigned_expr_name_sym(sm->name, sm->sym); in match_return() 52 if (!expr) in match_return() 54 if (expr->type != EXPR_CALL || expr->fn->type != EXPR_SYMBOL) in match_return() 56 if (!expr->fn->symbol_name) in match_return() 63 if (strcmp(expr->fn->symbol_name->name, "kmalloc") != 0 && in match_return() 64 strcmp(expr->fn->symbol_name->name, "kzalloc") != 0) in match_return()
|
H A D | check_frees_param_strict.c | 47 static int counter_was_inced(struct expression *expr) in counter_was_inced() argument 54 name = expr_to_var_sym(expr, &sym); in counter_was_inced() 65 static void match_free(const char *fn, struct expression *expr, void *param) in match_free() argument 70 arg = get_argument_from_call_expr(expr->args, PTR_INT(param)); in match_free() 89 static void set_param_freed(struct expression *expr, int param, char *key, char *value) in set_param_freed() argument 95 while (expr->type == EXPR_ASSIGNMENT) in set_param_freed() 96 expr = strip_expr(expr->right); in set_param_freed() 97 if (expr->type != EXPR_CALL) in set_param_freed() 100 arg = get_argument_from_call_expr(expr->args, param); in set_param_freed() 117 static void param_freed_info(int return_id, char *return_ranges, struct expression *expr) in param_freed_info() argument
|
H A D | check_no_effect.c | 24 struct expression *expr; in match_stmt() local 28 expr = stmt->expression; in match_stmt() 29 if (!expr) in match_stmt() 31 switch(expr->type) { in match_stmt() 33 if (expr->op == '!') in match_stmt() 35 if (expr->op == '~') in match_stmt() 50 sm_warning("statement has no effect %d", expr->type); in match_stmt()
|
H A D | check_err_ptr.c | 26 static void match_err_ptr(struct expression *expr) in match_err_ptr() argument 28 expr = strip_expr(expr); in match_err_ptr() 29 if (!expr) in match_err_ptr() 31 if (expr->type != EXPR_CALL) in match_err_ptr() 34 if (expr->fn->type != EXPR_SYMBOL || !expr->fn->symbol) in match_err_ptr() 36 if (!strcmp(expr->fn->symbol->ident->name, "ERR_PTR")) in match_err_ptr()
|
H A D | check_memset.c | 22 static void check_size_not_zero(struct expression *expr) in check_size_not_zero() argument 26 if (expr->type != EXPR_VALUE) in check_size_not_zero() 28 if (!get_value(expr, &sval)) in check_size_not_zero() 35 static void check_size_not_ARRAY_SIZE(struct expression *expr) in check_size_not_ARRAY_SIZE() argument 39 name = get_macro_name(expr->pos); in check_size_not_ARRAY_SIZE() 44 static void match_memset(const char *fn, struct expression *expr, void *data) in match_memset() argument 48 arg_expr = get_argument_from_call_expr(expr->args, 2); in match_memset()
|
/illumos-gate/usr/src/cmd/fm/modules/common/eversholt/ |
H A D | eft_mdb.c | 517 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 525 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 534 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 542 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 550 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 554 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 561 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 568 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 575 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() 582 (void) eft_node((uintptr_t)node.u.expr.left, DCMD_ADDRSPEC, 0, in eft_node() [all …]
|
H A D | eval.c | 325 np->u.expr.right->u.quote.s, in eval_func() 528 np->u.expr.right->u.quote.s); in eval_func() 654 np->u.expr.left->u.quote.s); in eval_func() 833 np->u.expr.left->u.quote.s); in eval_func() 987 switch (np->u.expr.temp) { in eval_dup() 999 switch (np->u.expr.temp) { in eval_dup() 1453 np->u.expr.left->u.globid.s, in eval_expr() 1617 ASSERT(np->u.expr.right == NULL); in eval_expr() 1676 retnp = np->u.expr.right->u.expr.left; in eval_expr() 1678 retnp = np->u.expr.right->u.expr.right; in eval_expr() [all …]
|
/illumos-gate/usr/src/cmd/geniconvtbl/ |
H A D | itm_comp.y | 95 %type <expr> expr 868 expr : PO expr PC 959 | expr PLUS expr 1113 | expr MUL expr 1187 | expr DIV expr 1261 | expr MOD expr 1335 | expr SHL expr 1415 | expr SHR expr 1495 | expr OR expr 1717 | expr EQ expr [all …]
|
/illumos-gate/usr/src/cmd/fm/eversholt/common/ |
H A D | ptree.c | 156 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 176 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 184 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 189 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 196 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 203 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 210 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 217 ptree(flags, np->u.expr.left, no_iterators, fileline); in ptree() 350 if (np->u.expr.left && np->u.expr.right && in ptree() 351 (np->u.expr.left->t != T_LIST || in ptree() [all …]
|