/illumos-gate/usr/src/tools/smatch/src/ |
H A D | smatch_struct_assignment.c | 117 expr = strip_expr(expr); in remove_addr() 118 if (!expr) in remove_addr() 121 if (expr->type == EXPR_PREOP && expr->op == '&') in remove_addr() 125 return expr; in remove_addr() 127 return expr; in remove_addr() 314 if (expr->type != EXPR_CALL || expr->fn->type != EXPR_SYMBOL) in returns_zeroed_mem() 389 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=') in returns_container_of() 428 __struct_members_copy(COPY_NORMAL, expr, expr->left, expr->right); in __fake_struct_member_assignments() 459 if (!expr || expr->type != EXPR_ASSIGNMENT) in match_memdup() 501 __struct_members_copy(COPY_MEMCPY, expr, expr->unop, NULL); in unop_expr() [all …]
|
H A D | smatch_modification_hooks.c | 55 expr = strip_expr(expr); in alloc_my_state() 56 name = expr_to_str(expr); in alloc_my_state() 66 data->cur = expr; in alloc_my_state() 161 expr = strip_expr(expr->right); in db_param_add() 191 call_modification_hooks(expr->left, expr, late); in match_assign() 196 if (expr->op != SPECIAL_DECREMENT && expr->op != SPECIAL_INCREMENT) in unop_expr() 199 call_modification_hooks(expr->unop, expr, late); in unop_expr() 221 struct expression *expr; in asm_expr() local 226 call_modification_hooks(expr->expr, NULL, late); in asm_expr() 237 unop_expr(expr, EARLY); in unop_expr_early() [all …]
|
H A D | check_pointer_math.c | 32 return (expr->type == EXPR_SIZEOF); in is_sizeof() 45 name = get_macro_name(expr->pos); in is_macro() 53 if (is_sizeof(expr)) in is_size_in_bytes() 56 if (is_macro(expr, "offsetof")) in is_size_in_bytes() 58 if (is_macro(expr, "PAGE_SIZE")) in is_size_in_bytes() 73 if (expr->op != '+') in match_binop() 84 size = get_array_size(expr->left); in match_binop() 93 name = expr_to_str(expr->left); in match_binop() 101 if (expr->op != '=') in match_assign() 114 if (expr->op != SPECIAL_ADD_ASSIGN && expr->op != SPECIAL_SUB_ASSIGN) in check_assign() [all …]
|
H A D | show-parse.c | 542 if (!expr) { in show_switch_statement() 753 fn = expr->fn; in show_call_expression() 861 if (!expr->ctype) in show_assignment() 876 if (expr && expr->ctype) { in show_return_stmt() 890 if (!expr->ctype) in show_initialization() 905 return show_load_gen(expr->ctype->bit_size, expr, addr); in show_access() 933 if (expr->op == SPECIAL_INCREMENT || expr->op == SPECIAL_DECREMENT) in show_preop() 966 if (expr) { in show_symbol_init() 1104 if (expr) in show_symbol_expr_init() 1115 if (!expr) in show_expression() [all …]
|
H A D | smatch_function_hooks.c | 315 if (expr->fn->type != EXPR_SYMBOL || !expr->fn->symbol) in call_implies_callbacks() 396 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=') in fake_a_param_assignment() 477 struct expression *expr = db_info->expr->left; in set_fresh_mtag_returns() local 497 struct expression *expr = db_info->expr->left; in set_return_assign_state() local 556 expr = strip_expr(expr->right); in impossible_limit() 623 expr = strip_expr(expr->right); in func_type_mismatch() 885 expr = strip_expr(db_info->expr); in call_ranged_return_hooks() 887 expr = strip_expr(expr->right); in call_ranged_return_hooks() 989 db_info.expr = expr; in db_return_states_assign() 1185 db_info.expr = expr; in db_return_states() [all …]
|
H A D | smatch_capped.c | 74 expr = strip_expr(expr); in is_capped() 75 while (expr && expr->type == EXPR_POSTOP) { in is_capped() 76 expr = strip_expr(expr->unop); in is_capped() 78 if (!expr) in is_capped() 81 type = get_type(expr); in is_capped() 99 if (expr->op == '&' && !get_value(expr->right, &sval)) in is_capped() 103 if (expr->op == '%' && in is_capped() 104 !get_value(expr->right, &sval) && is_capped(expr->right)) in is_capped() 108 if (expr->op == '/') in is_capped() 167 switch (expr->op) { in match_condition() [all …]
|
H A D | smatch_flow.c | 383 expr_set_parent_expr(expr->unop, expr); in __split_expr() 392 expr_set_parent_expr(expr->unop, expr); in __split_expr() 408 expr_set_parent_expr(expr->left, expr); in __split_expr() 415 expr_set_parent_expr(expr->left, expr); in __split_expr() 420 expr_set_parent_expr(expr->left, expr); in __split_expr() 430 expr_set_parent_expr(expr->left, expr); in __split_expr() 485 expr_set_parent_expr(expr->base, expr); in __split_expr() 527 expr_set_parent_expr(expr->fn, expr); in __split_expr() 534 split_expr_list(expr->args, expr); in __split_expr() 552 split_expr_list(expr->expr_list, expr); in __split_expr() [all …]
|
H A D | smatch_container_of.c | 37 expr = strip_expr(expr); in get_param_from_container_of() 66 expr = strip_expr(expr); in get_offset_from_container_of() 109 expr = expr->deref; in get_deref_count() 111 expr = expr->unop; in get_deref_count() 122 if (!expr || expr->type != EXPR_DEREF) in get_partial_deref() 124 expr = expr->deref; in get_partial_deref() 126 expr = expr->unop; in get_partial_deref() 146 expr = expr->deref; in partial_deref_to_offset_str() 148 expr = expr->unop; in partial_deref_to_offset_str() 225 expr = strip_expr(expr); in get_container_name_helper() [all …]
|
H A D | check_macros.c | 27 if (positions_eq(expr->pos, pos)) in match_inside() 29 if (positions_eq(expr->unop->pos, pos)) in match_inside() 48 if (positions_eq(expr->left->pos, pos)) in match_one_side() 62 if (expr->left->type == EXPR_PREOP) in match_join() 63 match_inside(expr->left, expr->pos); in match_join() 64 if (expr->right->type == EXPR_POSTOP) in match_join() 65 match_inside(expr->right, expr->pos); in match_join() 67 if (expr->left->type == EXPR_BINOP) in match_join() 68 match_one_side(expr->left, expr->pos, expr->op); in match_join() 69 if (expr->right->type == EXPR_BINOP) in match_join() [all …]
|
H A D | smatch_type.c | 117 if (!expr || expr->type != EXPR_SYMBOL || !expr->symbol) in get_type_symbol() 147 if (!expr || expr->type != EXPR_DEREF) in get_symbol_from_deref() 250 expr = expr->unop; in fake_pointer_sym() 262 expr = strip_parens(expr); in get_type_helper() 263 if (!expr) in get_type_helper() 266 if (expr->ctype) in get_type_helper() 340 expr = strip_parens(expr); in get_final_type_helper() 341 if (!expr) in get_final_type_helper() 546 expr = strip_expr(expr); in is_string() 547 if (!expr || expr->type != EXPR_STRING) in is_string() [all …]
|
H A D | smatch_address.c | 29 type = get_type(expr); in is_non_null_array() 38 if (expr->type != EXPR_DEREF || !expr->member) in is_non_null_array() 40 sym = expr_to_sym(expr); in is_non_null_array() 133 member = expr->member; in get_member_offset_from_deref() 218 if (expr->type == EXPR_PREOP && expr->op == '&') in handle_fn_address() 219 expr = strip_expr(expr->unop); in handle_fn_address() 250 expr = strip_expr(expr); in get_address_rl() 251 if (!expr) in get_address_rl() 267 if (expr->type == EXPR_PREOP && expr->op == '&') { in get_address_rl() 268 expr = strip_expr(expr->unop); in get_address_rl() [all …]
|
H A D | smatch_fresh_alloc.c | 109 if (!expr) in is_fresh_alloc() 118 if (expr->type != EXPR_CALL) in is_fresh_alloc() 120 if (fresh_from_db(expr)) in is_fresh_alloc() 132 if (!is_fresh_alloc(expr)) in record_alloc_func() 152 set_unfresh(expr->right); in match_assign() 169 expr = strip_expr(expr); in set_fresh() 172 if (expr == handled) in set_fresh() 175 get_absolute_rl(expr, &rl); in set_fresh() 180 handled = expr; in set_fresh() 190 set_fresh(expr->left); in returns_fresh_alloc() [all …]
|
H A D | smatch_strings.c | 78 expr = strip_expr(expr); in get_strings() 79 if (expr->type == EXPR_STRING) { in get_strings() 86 if (expr->type == EXPR_CONDITIONAL || in get_strings() 87 expr->type == EXPR_SELECT) { in get_strings() 92 return get_strings(expr->cond_true); in get_strings() 94 return get_strings(expr->cond_false); in get_strings() 103 sm = get_sm_state_expr(my_id, expr); in get_strings() 115 if (expr->op != '=') in match_assignment() 133 if (expr->type != EXPR_STRING || !expr->string->data) in match_string() 135 if (expr->string->length > 255) in match_string() [all …]
|
H A D | check_bit_shift.c | 38 expr = strip_expr(expr); in get_shifter() 39 if (expr->type != EXPR_VALUE) in get_shifter() 43 name = pos_ident(expr->pos); in get_shifter() 60 if (positions_eq(expr->pos, expr->right->pos)) in match_assign() 62 name = get_shifter(expr->right); in match_assign() 67 name, show_special(expr->op)); in match_assign() 74 if (positions_eq(expr->pos, expr->right->pos)) in match_binop() 76 if (expr->op != '&') in match_binop() 78 name = get_shifter(expr->right); in match_binop() 83 name, show_special(expr->op)); in match_binop() [all …]
|
H A D | check_implicit_dependencies.c | 156 sym = get_type(expr->deref); in print_read_member_type() 157 member_sym = get_type(expr); in print_read_member_type() 191 sym = get_type(expr->deref); in print_write_member_type() 192 member_sym = get_type(expr); in print_write_member_type() 227 match_condition(expr->left); in match_condition() 282 if (expr->op == SPECIAL_ADD_ASSIGN || expr->op == SPECIAL_INCREMENT || in unop_expr() 283 expr->op == SPECIAL_SUB_ASSIGN || expr->op == SPECIAL_DECREMENT || in unop_expr() 284 expr->op == SPECIAL_MUL_ASSIGN || expr->op == SPECIAL_DIV_ASSIGN || in unop_expr() 285 expr->op == SPECIAL_MOD_ASSIGN || expr->op == SPECIAL_AND_ASSIGN || in unop_expr() 286 expr->op == SPECIAL_OR_ASSIGN || expr->op == SPECIAL_XOR_ASSIGN || in unop_expr() [all …]
|
H A D | smatch_stored_conditions.c | 75 struct expression *expr; in clone_expression_list() local 79 } END_FOR_EACH_PTR(expr); in clone_expression_list() 89 if (tmp == expr) in insert_expression() 93 add_ptr_list(list, expr); in insert_expression() 99 struct expression *expr; in merge_links() local 150 state->data = expr; in alloc_state() 159 expr = strip_expr(expr); in store_all_links() 161 if (is_array(expr)) { in store_all_links() 167 switch (expr->type) { in store_all_links() 210 store_all_links(expr, expr); in __stored_condition() [all …]
|
H A D | smatch_untracked_param.c | 63 (*fn)(expr, param); in call_untracked_callbacks() 79 (*fn)(expr, param); in call_lost_callbacks() 111 expr = strip_expr(expr->right); in mark_untracked_lost() 112 if (expr->type != EXPR_CALL) in mark_untracked_lost() 147 fn = get_type(expr->fn); in lost_in_va_args() 152 name = expr_to_var(expr->fn); in lost_in_va_args() 166 if (lost_in_va_args(expr)) in match_after_call() 271 struct expression *tmp, *expr; in match_param_assign_in_asm() local 276 expr = strip_expr(tmp->expr); in match_param_assign_in_asm() 277 type = get_type(expr); in match_param_assign_in_asm() [all …]
|
H A D | dissect.c | 185 return report_member(mode, &expr->pos, ret, expr->symbol); in report_symbol() 296 if (expr->op == op) in peek_preop() 297 return expr->unop; in peek_preop() 299 expr = expr->unop; in peek_preop() 302 } while (expr); in peek_preop() 312 if (expr) switch (expr->type) { in do_expression() 314 warning(expr->pos, "bad expr->type: %d", expr->type); in do_expression() 376 if (expr->op != '+' && expr->op != '-') in do_expression() 387 switch (expr->op) { in do_expression() 443 } while ((expr = expr->down)); in do_expression() [all …]
|
H A D | check_readl_infinite_loops.c | 37 expr = strip_expr(expr); in is_readl_call() 38 if (expr->type != EXPR_CALL) in is_readl_call() 40 if (expr->fn->type != EXPR_SYMBOL) in is_readl_call() 42 sym = expr->fn->symbol; in is_readl_call() 52 if (is_readl_call(expr)) in is_readl() 54 if (get_state_expr(my_id, expr) == &readl) in is_readl() 61 if (is_readl(expr->right)) in match_assign() 69 if (expr->type == EXPR_BINOP) { in condition_depends_on_readl() 76 if (is_readl(expr)) in condition_depends_on_readl() 83 if (expr->op != '&') in check_condition() [all …]
|
H A D | expression.c | 72 *expr = e; in parens_expression() 171 *tree = expr; in builtin_types_compatible_p_expr() 202 *tree = expr; in builtin_offsetof_expr() 475 *tree = expr; in primary_expression() 484 if (!expr) in expression_list() 502 if (!expr) in postfix_expression() 526 expr = post; in postfix_expression() 560 expr = call; in postfix_expression() 569 *tree = expr; in postfix_expression() 582 *tree = expr; in type_info_expression() [all …]
|
H A D | check_debug.c | 124 arg = get_argument_from_call_expr(expr->args, 0); in match_print_known() 141 arg = get_argument_from_call_expr(expr->args, 0); in match_print_implied() 155 arg = get_argument_from_call_expr(expr->args, 0); in match_real_absolute() 523 static void mtag_info(struct expression *expr) in mtag_info() argument 529 expr_to_mtag_offset(expr, &tag, &offset); in mtag_info() 530 get_mtag_rl(expr, &rl); in mtag_info() 541 match_print_implied(fn, expr, NULL); in match_about() 542 match_buf_size(fn, expr, NULL); in match_about() 543 match_strlen(fn, expr, NULL); in match_about() 544 match_real_absolute(fn, expr, NULL); in match_about() [all …]
|
H A D | smatch_bits.c | 133 if (!expr || expr->type != EXPR_ASSIGNMENT) in handled_by_assign_hook() 137 if (is_loop_iterator(expr)) in handled_by_assign_hook() 140 if (expr->op == '=' || in handled_by_assign_hook() 249 expr = strip_parens(expr); in get_bit_info() 254 if (expr->type == EXPR_BINOP) { in get_bit_info() 255 if (expr->op == '&') in get_bit_info() 258 if (expr->op == '|') in get_bit_info() 263 if (get_implied_rl(expr, &rl)) in get_bit_info() 271 type = get_type(expr); in get_bit_info() 333 if (expr->op == '=') { in match_assign() [all …]
|
H A D | smatch_parse_call_math.c | 274 expr = strip_expr(expr); in get_arg_number() 277 sym = expr->symbol; in get_arg_number() 363 if (!expr) in format_expr_helper() 428 expr = tmp; in get_value_in_terms_of_parameter_math() 429 if (param_was_set(expr)) in get_value_in_terms_of_parameter_math() 451 if (!expr) in get_value_in_terms_of_parameter_math_var_sym() 558 if (is_fake_call(expr)) in get_allocation_recipe_from_call() 560 expr = strip_expr(expr); in get_allocation_recipe_from_call() 563 sym = expr->fn->symbol; in get_allocation_recipe_from_call() 613 expr = strip_expr(expr); in get_allocation_math() [all …]
|
/illumos-gate/usr/src/cmd/awk_xpg4/ |
H A D | awk.y | 197 | expr COMMA expr = { 263 | expr STAR expr = { 272 | expr EXP expr = { 275 | expr AND expr = { 278 | expr OR expr = { 281 | expr QUEST expr COLON expr = { 311 | expr EQ expr = { 314 | expr NE expr = { 323 | expr GE expr = { 326 | expr LE expr = { [all …]
|
/illumos-gate/usr/src/lib/libdwarf/common/ |
H A D | pro_expr.c | 134 if (expr == NULL) { in dwarf_add_expr_gen_a() 138 dbg = expr->ex_dbg; in dwarf_add_expr_gen_a() 140 if (expr->ex_dbg == NULL) { in dwarf_add_expr_gen_a() 494 &(expr->ex_byte_stream[0]) + expr->ex_next_byte_offset; in dwarf_add_expr_gen_a() 536 if (expr == NULL) { in dwarf_add_expr_addr_c() 541 dbg = expr->ex_dbg; in dwarf_add_expr_addr_c() 555 &(expr->ex_byte_stream[0]) + expr->ex_next_byte_offset; in dwarf_add_expr_addr_c() 568 expr->ex_reloc_offset = expr->ex_next_byte_offset + 1; in dwarf_add_expr_addr_c() 618 if (expr == NULL) { in dwarf_expr_current_offset_a() 634 if (expr == NULL) { in dwarf_expr_reset() [all …]
|