/illumos-gate/usr/src/tools/smatch/src/ |
H A D | check_frees_param.c | 38 static void freed_variable(struct expression *expr) in freed_variable() argument 42 expr = strip_expr(expr); in freed_variable() 43 if (get_param_num(expr) < 0) in freed_variable() 46 sm = get_sm_state_expr(my_id, expr); in freed_variable() 49 set_state_expr(my_id, expr, &freed); in freed_variable() 52 static void match_free(const char *fn, struct expression *expr, void *param) in match_free() argument 56 arg = get_argument_from_call_expr(expr->args, PTR_INT(param)); in match_free()
|
H A D | check_expects_err_ptr.c | 45 static int get_arg_num(struct expression *expr) in get_arg_num() argument 52 expr = strip_expr(expr); in get_arg_num() 53 if (expr->type != EXPR_SYMBOL) in get_arg_num() 55 this_arg = expr->symbol; in get_arg_num() 57 state = get_state_expr(my_id, expr); in get_arg_num() 71 static void match_is_err(const char *fn, struct expression *expr, void *unused) in match_is_err() argument 76 arg = get_argument_from_call_expr(expr->args, 0); in match_is_err()
|
H A D | check_input_free_device.c | 32 static void match_assign(struct expression *expr) in match_assign() argument 34 if (get_state_expr(my_id, expr->left)) { in match_assign() 35 set_state_expr(my_id, expr->left, &ok); in match_assign() 39 static void match_input_unregister(const char *fn, struct expression *expr, void *data) in match_input_unregister() argument 43 arg = get_argument_from_call_expr(expr->args, 0); in match_input_unregister() 47 static void match_input_free(const char *fn, struct expression *expr, void *data) in match_input_free() argument 52 arg = get_argument_from_call_expr(expr->args, 0); in match_input_free()
|
H A D | check_container_of.c | 35 static void match_non_null(const char *fn, struct expression *expr, void *unused) in match_non_null() argument 37 set_state_expr(my_id, expr->left, &non_null); in match_non_null() 40 static void match_condition(struct expression *expr) in match_condition() argument 45 if (get_macro_name(expr->pos)) in match_condition() 48 if (get_state_expr(my_id, expr) == &non_null) { in match_condition() 51 name = expr_to_var(expr); in match_condition() 53 set_state_expr(my_id, expr, &undefined); in match_condition()
|
H A D | check_locking.c | 444 return expr; in remove_spinlock_check() 446 return expr; in remove_spinlock_check() 449 expr = get_argument_from_call_expr(expr->args, 0); in remove_spinlock_check() 450 return expr; in remove_spinlock_check() 464 expr = remove_spinlock_check(expr); in lock_to_name_sym() 465 expr = filter_kernel_args(expr); in lock_to_name_sym() 647 while (expr && expr->type == EXPR_ASSIGNMENT) in handle_macro_lock_unlock() 648 expr = strip_expr(expr->right); in handle_macro_lock_unlock() 649 if (!expr || expr->type != EXPR_CALL) in handle_macro_lock_unlock() 861 if (expr) { in get_param_lock_name() [all …]
|
H A D | smatch_impossible.c | 62 static void match_condition(struct expression *expr) in match_condition() argument 64 if (expr->type == EXPR_COMPARE) in match_condition() 65 handle_compare(expr->left, expr->op, expr->right); in match_condition() 67 handle_compare(expr, SPECIAL_NOTEQUAL, zero_expr()); in match_condition() 80 static void match_case(struct expression *expr, struct range_list *rl) in match_case() argument 87 static void print_impossible_return(int return_id, char *return_ranges, struct expression *expr) in print_impossible_return() argument
|
H A D | check_all_func_returns.c | 26 static void check_func_return(struct expression *expr) in check_func_return() argument 28 struct symbol *sym = get_real_base_type(get_type(expr->fn)); in check_func_return() 29 const char *func = expr_to_str(expr->fn); in check_func_return() 37 if (expr->type != EXPR_CALL) { in check_func_return() 59 const char *arg0 = expr_to_str(get_argument_from_call_expr(expr->args, 0)); in check_func_return() 77 if (stmt && stmt->type == STMT_EXPRESSION && stmt->expression == expr) in check_func_return() 78 sm_error("unchecked function return '%s'", expr_to_str(expr->fn)); in check_func_return()
|
H A D | smatch_return_to_param.c | 121 char *map_call_to_param_name_sym(struct expression *expr, struct symbol **sym) in map_call_to_param_name_sym() argument 129 name = expr_to_str_sym(expr, &start_sym); in map_call_to_param_name_sym() 132 if (expr->type == EXPR_CALL) in map_call_to_param_name_sym() 133 start_sym = expr_to_sym(expr->fn); in map_call_to_param_name_sym() 194 if (expr->type == EXPR_ASSIGNMENT) { in __add_return_to_param_mapping() 195 left_name = expr_to_var_sym(expr->left, &left_sym); in __add_return_to_param_mapping() 199 call = strip_expr(expr->right); in __add_return_to_param_mapping() 207 if (expr->type == EXPR_CALL && in __add_return_to_param_mapping() 208 expr_get_parent_stmt(expr) && in __add_return_to_param_mapping() 209 expr_get_parent_stmt(expr)->type == STMT_RETURN) { in __add_return_to_param_mapping() [all …]
|
H A D | check_info_leak.c | 26 static char *my_get_variable(struct expression *expr, struct symbol **sym) in my_get_variable() argument 30 name = expr_to_var_sym(expr, sym); in my_get_variable() 38 static void match_kmalloc(const char *fn, struct expression *expr, void *unused) in match_kmalloc() argument 43 name = my_get_variable(expr->left, &sym); in match_kmalloc() 49 static void match_strcpy(const char *fn, struct expression *expr, void *unused) in match_strcpy() argument 55 dest = get_argument_from_call_expr(expr->args, 0); in match_strcpy() 64 static void match_copy_to_user(const char *fn, struct expression *expr, void *unused) in match_copy_to_user() argument 71 src = get_argument_from_call_expr(expr->args, 1); in match_copy_to_user()
|
H A D | check_kmalloc_wrong_size.c | 48 static void match_alloc(const char *fn, struct expression *expr, void *unused) in match_alloc() argument 50 struct expression *call = strip_expr(expr->right); in match_alloc() 54 ptr_size = get_data_size(expr->left); in match_alloc() 62 if (expr->left->type == EXPR_SIZEOF) in match_alloc() 64 if (expr->right->type == EXPR_SIZEOF) in match_alloc() 68 static void match_calloc(const char *fn, struct expression *expr, void *_arg_nr) in match_calloc() argument 71 struct expression *call = strip_expr(expr->right); in match_calloc() 75 ptr_size = get_data_size(expr->left); in match_calloc()
|
H A D | check_return_negative_var.c | 25 struct expression *expr; in match_return() local 30 expr = ret_value; in match_return() 34 macro = get_macro_name(expr->unop->pos); in match_return() 43 expr = get_assigned_expr(ret_value->unop); in match_return() 44 if (!expr) in match_return() 46 if (expr->type != EXPR_CALL) in match_return()
|
H A D | check_min_t.c | 22 static void match_assign(struct expression *expr) in match_assign() argument 28 if (expr->op != '=') in match_assign() 31 macro = get_macro_name(expr->pos); in match_assign() 37 if (!get_absolute_max(expr->left, &max_left)) in match_assign() 39 if (!get_absolute_max(expr->right, &max_right)) in match_assign() 45 name = expr_to_str(expr->right); in match_assign()
|
H A D | smatch_param_set.c | 99 static void match_array_assignment(struct expression *expr) in match_array_assignment() argument 111 if (!is_array(expr->left)) in match_array_assignment() 113 array = get_array_base(expr->left); in match_array_assignment() 114 offset = get_array_offset(expr->left); in match_array_assignment() 124 get_absolute_rl(expr->right, &rl); in match_array_assignment() 125 rl = cast_rl(get_type(expr->left), rl); in match_array_assignment() 260 print_return_value_param_helper(return_id, return_ranges, expr, 0); in print_return_value_param() 263 void print_limited_param_set(int return_id, char *return_ranges, struct expression *expr) in print_limited_param_set() argument 265 print_return_value_param_helper(return_id, return_ranges, expr, 1000); in print_limited_param_set() 313 int param_was_set(struct expression *expr) in param_was_set() argument [all …]
|
H A D | check_allocating_enough_data.c | 20 static void db_returns_buf_size(struct expression *expr, int param, char *unused, char *math) in db_returns_buf_size() argument 28 if (expr->type != EXPR_ASSIGNMENT) in db_returns_buf_size() 30 right_type = get_pointer_type(expr->right); in db_returns_buf_size() 34 call = strip_expr(expr->right); in db_returns_buf_size() 35 left_type = get_pointer_type(expr->left); in db_returns_buf_size() 47 str = expr_to_str(expr->left); in db_returns_buf_size()
|
H A D | smatch_array_values.c | 109 int get_array_rl(struct expression *expr, struct range_list **rl) in get_array_rl() argument 116 type = get_type(expr); in get_array_rl() 121 array = get_array_base(expr); in get_array_rl() 159 static void match_assign(struct expression *expr) in match_assign() argument 166 type = get_type(expr->left); in match_assign() 170 left = strip_expr(expr->left); in match_assign() 178 if (expr->op != '=') { in match_assign() 179 rl = alloc_whole_rl(get_type(expr->right)); in match_assign() 182 get_absolute_rl(expr->right, &rl); in match_assign() 191 static void mark_strings_unknown(const char *fn, struct expression *expr, void *_arg) in mark_strings_unknown() argument [all …]
|
H A D | check_select.c | 23 static void match_select(struct expression *expr) in match_select() argument 25 if (expr->cond_true) in match_select() 27 expr = strip_expr(expr->conditional); in match_select() 28 if (expr->type != EXPR_COMPARE) in match_select()
|
H A D | check_array_condition.c | 30 static void match_condition(struct expression *expr) in match_condition() argument 35 if (expr->type != EXPR_DEREF) in match_condition() 37 type = get_type(expr); in match_condition() 40 if (get_macro_name(expr->pos)) in match_condition() 43 str = expr_to_str(expr); in match_condition()
|
H A D | check_dev_queue_xmit.c | 60 static void match_symbol(struct expression *expr) in match_symbol() argument 65 sm = get_sm_state_expr(my_id, expr); in match_symbol() 70 name = expr_to_var(expr); in match_symbol() 75 static void match_kfree_skb(const char *fn, struct expression *expr, void *param) in match_kfree_skb() argument 79 arg = get_argument_from_call_expr(expr->args, 0); in match_kfree_skb() 85 static void match_xmit(const char *fn, struct expression *expr, void *param) in match_xmit() argument 89 arg = get_argument_from_call_expr(expr->args, PTR_INT(param)); in match_xmit()
|
H A D | check_dma_mapping_error.c | 33 static void match_assign(const char *fn, struct expression *expr, void *unused) in match_assign() argument 37 if (!get_implied_rl(expr->right, &rl)) in match_assign() 41 set_state_expr(my_id, expr->left, &positive); in match_assign() 44 static void match_condition(struct expression *expr) in match_condition() argument 46 if (!get_state_expr(my_id, expr)) in match_condition() 49 set_true_false_states_expr(my_id, expr, NULL, &ok); in match_condition()
|
/illumos-gate/usr/src/cmd/fm/eversholt/common/ |
H A D | check.c | 421 nvpairnp->u.expr.right); in check_stmt_allowed_properties() 447 nvpairnp->u.expr.right) == 0) in check_stmt_allowed_properties() 453 nvpairnp->u.expr.right) == 0) in check_stmt_allowed_properties() 895 check_cycle_rhs(rhs->u.expr.left); in check_cycle_rhs() 896 check_cycle_rhs(rhs->u.expr.right); in check_cycle_rhs() 970 check_cat_list(np->u.expr.left); in check_cat_list() 971 check_cat_list(np->u.expr.right); in check_cat_list() 1053 if (arglist->u.expr.left->u.ull > in check_func() 1095 check_func(arglist->u.expr.left); in check_func() 1181 arglist->u.expr.right == NULL) in check_func() [all …]
|
/illumos-gate/usr/src/cmd/expr/ |
H A D | Makefile | 26 PROG= expr 27 XPG4PROG= expr 28 XPG6PROG= expr 30 EXPROBJ= exprobjs/expr.o exprobjs/compile.o 31 XPG4EXPROBJ= exprobjs.xpg4/expr.o exprobjs.xpg4/compile.o 32 XPG6EXPROBJ= exprobjs.xpg6/expr.o exprobjs.xpg6/compile.o 35 SRCS= expr.c compile.c 47 XGETFLAGS += -a -x expr.xcl
|
/illumos-gate/usr/src/lib/libc/port/i18n/ |
H A D | plural_parser.c | 88 static struct expr * 108 static struct expr * 109 stack_pop(struct stack *stk, struct expr *exp_a, struct expr *exp_b) in stack_pop() 132 freeexpr(struct expr *e) in freeexpr() 158 static struct expr * 162 struct expr *newitem; in setop1() 173 newitem = (struct expr *)calloc(1, sizeof (struct expr)); in setop1() 185 static struct expr * 187 struct expr *exp1, struct expr *exp2, struct expr *exp3) in setop_reduce() 189 struct expr *newitem; in setop_reduce() [all …]
|
/illumos-gate/usr/src/cmd/bnu/ |
H A D | uuto | 45 else error=`expr 0$error + 1` 62 error=`expr 0$error + 0$?` 69 error=`expr 0$error + 0$?` 101 shift `expr $OPTIND - 1` 118 remote=`expr $1 : '\(.*\)!'` 119 user=`expr $1 : '.*!\(.*\)'`
|
/illumos-gate/usr/src/contrib/ast/src/cmd/ksh93/tests/ |
H A D | grep.sh | 49 -e*) shift;expr="$1";; 50 -f*) shift;expr=$(< $1);; 53 if test "$expr" = '' 54 then expr="$1";shift 56 test "$xflag" || expr="*${expr}*" 72 $expr) # line matches pattern
|
/illumos-gate/usr/src/contrib/ast/src/lib/libast/regex/ |
H A D | regdecomp.c | 94 if (decomp(e->re.group.expr.binary.left, sp, type, delimiter, flags)) in decomp() 97 …if (e->re.group.expr.binary.right && decomp(e->re.group.expr.binary.right, sp, type, delimiter, fl… in decomp() 147 if (decomp(e->re.group.expr.rex, sp, type, delimiter, flags)) in decomp() 324 if (decomp(e->re.group.expr.rex, sp, type, delimiter, flags)) in decomp() 342 if (decomp(e->re.group.expr.rex, sp, type, delimiter, flags)) in decomp() 352 if (decomp(e->re.group.expr.rex, sp, type, delimiter, flags)) in decomp() 359 …if (e->re.group.expr.binary.left && decomp(e->re.group.expr.binary.left, sp, type, delimiter, flag… in decomp() 361 if (q = e->re.group.expr.binary.right) in decomp() 364 …if (q->re.group.expr.binary.left && decomp(q->re.group.expr.binary.left, sp, type, delimiter, flag… in decomp() 367 …if (q->re.group.expr.binary.right && decomp(q->re.group.expr.binary.right, sp, type, delimiter, fl… in decomp() [all …]
|