Lines Matching refs:right

183 	    (faked->type == EXPR_ASSIGNMENT && is_fresh_alloc(faked->right)))  in set_extra_mod_helper()
596 … get_countdown_info(struct expression *condition, struct expression **unop, int *op, sval_t *right) in get_countdown_info() argument
602 right->type = &int_ctype; in get_countdown_info()
603 right->value = 0; in get_countdown_info()
612 if (!get_value(condition->right, &limit)) in get_countdown_info()
623 *right = limit; in get_countdown_info()
647 sval_t start, right; in handle_canonical_while_count_down() local
649 right.type = &int_ctype; in handle_canonical_while_count_down()
650 right.value = 0; in handle_canonical_while_count_down()
656 if (!get_countdown_info(condition, &unop, &op, &right)) in handle_canonical_while_count_down()
664 if (sval_cmp(estate_min(sm->state), right) < 0) in handle_canonical_while_count_down()
669 right = sval_cast(type, right); in handle_canonical_while_count_down()
672 if (sval_cmp(start, right) <= 0) in handle_canonical_while_count_down()
678 right.value--; in handle_canonical_while_count_down()
681 right.value++; in handle_canonical_while_count_down()
682 estate = alloc_estate_range(right, start); in handle_canonical_while_count_down()
689 estate = alloc_estate_range(right, start); in handle_canonical_while_count_down()
713 if (!get_implied_value(condition->right, &end)) in handle_canonical_for_inc()
738 if (get_hard_max(condition->right, &max)) { in handle_canonical_for_inc()
766 if (!get_implied_min(condition->right, &end)) in handle_canonical_for_dec()
1002 int values_fit_type(struct expression *left, struct expression *right) in values_fit_type() argument
1010 get_absolute_rl(right, &rl); in values_fit_type()
1022 static void save_chunk_info(struct expression *left, struct expression *right) in save_chunk_info() argument
1032 if (right->type != EXPR_BINOP || right->op != '-') in save_chunk_info()
1034 if (!get_value(right->left, &sval)) in save_chunk_info()
1036 if (!expr_to_sym(right->right)) in save_chunk_info()
1039 add_expr = binop_expression(left, '+', right->right); in save_chunk_info()
1055 static void do_array_assign(struct expression *left, int op, struct expression *right) in do_array_assign() argument
1060 get_absolute_rl(right, &rl); in do_array_assign()
1069 static void match_vanilla_assign(struct expression *left, struct expression *right) in match_vanilla_assign() argument
1086 save_chunk_info(left, right); in match_vanilla_assign()
1091 do_array_assign(left, '=', right); in match_vanilla_assign()
1096 right_type = get_type(right); in match_vanilla_assign()
1098 right_name = expr_to_var_sym(right, &right_sym); in match_vanilla_assign()
1101 !(right->type == EXPR_PREOP && right->op == '&') && in match_vanilla_assign()
1103 values_fit_type(left, strip_expr(right)) && in match_vanilla_assign()
1104 !has_symbol(right, sym)) { in match_vanilla_assign()
1105 set_equiv(left, right); in match_vanilla_assign()
1109 if (get_implied_value(right, &sval)) { in match_vanilla_assign()
1118 if (get_value(right, &sval)) { in match_vanilla_assign()
1135 comparison = get_comparison_no_extra(left, right); in match_vanilla_assign()
1141 if (get_implied_rl(right, &rl)) { in match_vanilla_assign()
1146 if (get_hard_max(right, &max)) { in match_vanilla_assign()
1168 struct expression *right; in match_assign() local
1176 right = strip_parens(expr->right); in match_assign()
1177 if (right->type == EXPR_CALL && sym_name_is("__builtin_expect", right->fn)) in match_assign()
1178 right = get_argument_from_call_expr(right->args, 0); in match_assign()
1179 while (right->type == EXPR_ASSIGNMENT && right->op == '=') in match_assign()
1180 right = strip_parens(right->left); in match_assign()
1182 if (expr->op == '=' && is_condition(expr->right)) in match_assign()
1184 if (expr->op == '=' && right->type == EXPR_CALL) in match_assign()
1187 match_vanilla_assign(left, right); in match_assign()
1210 expr->right); in match_assign()
1425 static int handle_postop_inc(struct expression *left, int op, struct expression *right) in handle_postop_inc() argument
1455 if (left != strip_expr(cond->left) || right != strip_expr(cond->right)) in handle_postop_inc()
1460 if (!get_implied_value(right, &limit)) in handle_postop_inc()
1501 static bool in_macro(struct expression *left, struct expression *right) in in_macro() argument
1503 if (!left || !right) in in_macro()
1505 if (left->pos.line != right->pos.line || left->pos.pos != right->pos.pos) in in_macro()
1512 …d handle_comparison(struct symbol *type, struct expression *left, int op, struct expression *right) in handle_comparison() argument
1532 if (handle_postop_inc(left, op, right)) in handle_comparison()
1540 if (right->op == SPECIAL_INCREMENT || right->op == SPECIAL_DECREMENT) { in handle_comparison()
1541 if (right->type == EXPR_POSTOP) { in handle_comparison()
1542 right->smatch_flags |= Handled; in handle_comparison()
1543 right_postop = right->op; in handle_comparison()
1545 right = strip_parens(right->unop); in handle_comparison()
1548 if (is_impossible_variable(left) || is_impossible_variable(right)) in handle_comparison()
1554 get_real_absolute_rl(right, &right_orig); in handle_comparison()
1561 right_true = rl_truncate_cast(get_type(strip_expr(right)), right_true); in handle_comparison()
1562 right_false = rl_truncate_cast(get_type(strip_expr(right)), right_false); in handle_comparison()
1578 tmp_true = rl_truncate_cast(get_type(strip_expr(right)), tmp_true); in handle_comparison()
1579 tmp_false = rl_truncate_cast(get_type(strip_expr(right)), tmp_false); in handle_comparison()
1581 __save_imaginary_state(right, tmp_true, tmp_false); in handle_comparison()
1594 if (get_implied_value(right, &dummy) && !in_macro(left, right)) in handle_comparison()
1596 if (get_implied_value(left, &dummy) && !in_macro(left, right)) in handle_comparison()
1603 if (get_implied_value(left, &dummy) && !in_macro(left, right)) in handle_comparison()
1605 if (get_implied_value(right, &dummy) && !in_macro(left, right)) in handle_comparison()
1615 if (get_hard_max(right, &hard_max)) { in handle_comparison()
1620 if (get_implied_value(right, &hard_max)) { in handle_comparison()
1653 if (get_hard_max(right, &hard_max)) { in handle_comparison()
1659 if (get_implied_value(right, &hard_max)) { in handle_comparison()
1669 if (get_hard_max(right, &hard_max)) in handle_comparison()
1678 if (get_hard_max(right, &hard_max)) { in handle_comparison()
1721 set_extra_expr_true_false(right, right_true_state, right_false_state); in handle_comparison()
1762 if (get_implied_value(expr->right, &sval)) { in move_known_to_rl()
1771 *expr_p = expr->right; in move_known_to_rl()
1781 struct expression *right = *right_p; in move_known_values() local
1785 if (!is_simple_math(right)) in move_known_values()
1787 if (get_implied_value(right, &dummy)) in move_known_values()
1789 if (right->op == '*') { in move_known_values()
1792 if (!get_value(right->right, &divisor)) in move_known_values()
1796 *left_p = binop_expression(left, invert_op(right->op), right->right); in move_known_values()
1797 *right_p = right->left; in move_known_values()
1800 if (right->op == '+' && get_value(right->left, &sval)) { in move_known_values()
1801 *left_p = binop_expression(left, invert_op(right->op), right->left); in move_known_values()
1802 *right_p = right->right; in move_known_values()
1805 if (get_value(right->right, &sval)) { in move_known_values()
1806 *left_p = binop_expression(left, invert_op(right->op), right->right); in move_known_values()
1807 *right_p = right->left; in move_known_values()
1812 if (get_implied_value(right, &sval)) { in move_known_values()
1820 if (!get_value(left->right, &divisor)) in move_known_values()
1824 *right_p = binop_expression(right, invert_op(left->op), left->right); in move_known_values()
1829 *right_p = binop_expression(right, invert_op(left->op), left->left); in move_known_values()
1830 *left_p = left->right; in move_known_values()
1834 if (get_value(left->right, &sval)) { in move_known_values()
1835 *right_p = binop_expression(right, invert_op(left->op), left->right); in move_known_values()
1853 struct expression *right = *right_p; in do_simple_algebra() local
1861 if (!get_implied_value(right, &tmp)) in do_simple_algebra()
1867 *right_p = binop_expression(right, '-', left->left); in do_simple_algebra()
1868 *left_p = left->right; in do_simple_algebra()
1871 if (!get_implied_value(left->right, &tmp) && in do_simple_algebra()
1872 get_implied_rl(left->right, &rl) && in do_simple_algebra()
1874 *right_p = binop_expression(right, '-', left->right); in do_simple_algebra()
1885 struct expression *right = strip_expr(expr->right); in match_func_comparison() local
1887 if (left->type == EXPR_CALL || right->type == EXPR_CALL) { in match_func_comparison()
1888 function_comparison(left, expr->op, right); in match_func_comparison()
1898 struct expression *left, *right; in handle_integer_overflow_test() local
1906 right = strip_parens(expr->right); in handle_integer_overflow_test()
1924 if (!expr_equiv(left->left, right) && !expr_equiv(left->right, right)) in handle_integer_overflow_test()
1928 get_absolute_min(left->right, &right_min); in handle_integer_overflow_test()
1942 struct expression *right_orig = strip_parens(expr->right); in match_comparison()
1943 struct expression *left, *right, *tmp; in match_comparison() local
1959 right = right_orig; in match_comparison()
1960 move_known_values(&left, &right); in match_comparison()
1961 handle_comparison(type, left, expr->op, right); in match_comparison()
1964 right = right_orig; in match_comparison()
1965 if (do_simple_algebra(&left, &right)) in match_comparison()
1966 handle_comparison(type, left, expr->op, right); in match_comparison()
1971 right = right_orig; in match_comparison()
1972 move_known_values(&left, &right); in match_comparison()
1973 handle_comparison(type, left, expr->op, right); in match_comparison()
1979 right = prev; in match_comparison()
1980 move_known_values(&left, &right); in match_comparison()
1981 handle_comparison(type, left, expr->op, right); in match_comparison()
1986 right = right_orig; in match_comparison()
1992 right = get_last_expr_from_expression_stmt(right_orig); in match_comparison()
2006 while ((tmp = get_assigned_expr(right))) { in match_comparison()
2009 right = strip_expr(tmp); in match_comparison()
2012 handle_comparison(type, left, expr->op, right); in match_comparison()
2042 shift = strip_expr(expr->right); in handle_bit_test()
2046 mask = strip_expr(expr->right); in handle_bit_test()
2052 var = strip_expr(shift->right); in handle_bit_test()
2073 set_extra_expr_true_false(shift->right, alloc_estate_rl(rl), NULL); in handle_bit_test()
2128 handle_AND_op(expr->right, known); in handle_AND_condition()
2129 else if (get_implied_value(expr->right, &known)) in handle_AND_condition()
2138 sval_t right; in handle_MOD_condition() local
2141 if (!get_implied_value(expr->right, &right) || right.value == 0) in handle_MOD_condition()
2151 !(rl_max(true_rl).value % right.value)) in handle_MOD_condition()
2158 (rl_max(orig_rl).value - rl_min(orig_rl).value) / right.value < 5) { in handle_MOD_condition()
2163 add.value += right.value - (add.value % right.value); in handle_MOD_condition()
2164 add.value -= right.value; in handle_MOD_condition()
2167 add.value += right.value; in handle_MOD_condition()
2174 rl_min(orig_rl).uvalue < right.uvalue) { in handle_MOD_condition()
2175 sval_t chop = right; in handle_MOD_condition()
2181 (rl_max(orig_rl).value % right.value)) { in handle_MOD_condition()
2183 chop.value -= chop.value % right.value; in handle_MOD_condition()
2563 if (!get_implied_value(arg->right, &sval)) in db_param_limit_binops()
2590 expr = strip_expr(expr->right); in db_param_limit_filter()
2671 expr = strip_expr(expr->right); in db_param_add_set()
2753 call = strip_expr(call->right); in db_param_value()