/illumos-gate/usr/src/tools/smatch/src/ |
H A D | smatch_sval.c | 33 __ALLOCATOR(sval_t, "svals", sval); 35 sval_t *sval_alloc(sval_t sval) in sval_alloc() argument 40 *ret = sval; in sval_alloc() 44 sval_t *sval_alloc_permanent(sval_t sval) in sval_alloc_permanent() argument 49 *ret = sval; in sval_alloc_permanent() 108 int sval_is_ptr(sval_t sval) in sval_is_ptr() argument 110 if (!sval.type) in sval_is_ptr() 112 return (sval.type->type == SYM_PTR || sval.type->type == SYM_ARRAY); in sval_is_ptr() 115 bool sval_is_fp(sval_t sval) in sval_is_fp() argument 117 return type_is_fp(sval.type); in sval_is_fp() [all …]
|
H A D | smatch_math.c | 96 sval_t sval; in handle_address() local 112 if (get_mtag_sval(expr, &sval)) { in handle_address() 114 *res_sval = sval; in handle_address() 161 sval_t sval = {}; in handle_bitwise_negate() local 163 if (!get_rl_sval(expr->unop, implied, recurse_cnt, &rl, &sval)) in handle_bitwise_negate() 165 if (!sval.type && !rl_to_sval(rl, &sval)) in handle_bitwise_negate() 167 sval = sval_preop(sval, '~'); in handle_bitwise_negate() 168 sval_cast(get_type(expr->unop), sval); in handle_bitwise_negate() 169 *res_sval = sval; in handle_bitwise_negate() 188 sval_t sval = {}; in handle_minus_preop() local [all …]
|
H A D | smatch_buf_size.c | 65 sval_t sval; in estate_to_size() local 69 sval = estate_max(state); in estate_to_size() 70 return sval.value; in estate_to_size() 75 sval_t sval; in size_to_estate() local 77 sval.type = &int_ctype; in size_to_estate() 78 sval.value = size; in size_to_estate() 80 return alloc_estate_sval(sval); in size_to_estate() 85 sval_t sval; in size_to_rl() local 87 sval.type = &int_ctype; in size_to_rl() 88 sval.value = size; in size_to_rl() [all …]
|
H A D | check_or_vs_and.c | 44 sval_t sval; in inconsistent_check() local 46 if (get_value(left->left, &sval)) { in inconsistent_check() 47 if (get_value(right->left, &sval)) in inconsistent_check() 49 if (get_value(right->right, &sval)) in inconsistent_check() 53 if (get_value(left->right, &sval)) { in inconsistent_check() 54 if (get_value(right->left, &sval)) in inconsistent_check() 56 if (get_value(right->right, &sval)) in inconsistent_check() 143 sval_t sval; in match_condition() local 148 if (get_value(expr->left, &sval) || get_value(expr->right, &sval)) in match_condition() 161 if ((get_value(expr->left, &sval) && sval.value == 0) || in match_condition() [all …]
|
H A D | check_impossible_mask.c | 25 sval_t sval; 32 if (get_implied_value(expr, &sval)) 33 return sval.uvalue; 50 get_absolute_max(expr, &sval); 51 ret = sval.value; 66 sval_t sval; in get_possible_bits() local 73 if (!get_implied_value(expr->right, &sval)) in get_possible_bits() 76 return sval.uvalue; in get_possible_bits() 82 sval_t sval; in match_condition() local 95 if (!get_value(expr->right, &sval)) in match_condition() [all …]
|
H A D | smatch_mtag.c | 97 sval_t sval; in get_allocator_info() local 101 if (estate_get_single_value(state, &sval)) in get_allocator_info() 102 return get_allocator_info_from_tag(sval.value); in get_allocator_info() 236 sval_t sval; in get_array_mtag_offset() local 256 if (!get_value(offset_expr, &sval)) in get_array_mtag_offset() 258 *offset = start_offset + sval.value * type_bytes(type); in get_array_mtag_offset() 267 sval_t sval; in swap_mtag_seed() local 270 if (!rl_to_sval(rl, &sval)) in swap_mtag_seed() 272 if (sval.type->type != SYM_PTR || sval.uvalue != MTAG_SEED) in swap_mtag_seed() 279 sval.value = tag; in swap_mtag_seed() [all …]
|
H A D | smatch_strlen.c | 38 sval_t sval; in size_to_estate() local 40 sval.type = &int_ctype; in size_to_estate() 41 sval.value = size; in size_to_estate() 43 return alloc_estate_sval(sval); in size_to_estate() 102 sval_t sval; in match_strlen_condition() local 129 if (!get_value(right, &sval)) in match_strlen_condition() 133 if (!get_value(left, &sval)) in match_strlen_condition() 140 true_state = size_to_estate(sval.value - 1); in match_strlen_condition() 144 true_state = size_to_estate(sval.value); in match_strlen_condition() 147 true_state = size_to_estate(sval.value); in match_strlen_condition() [all …]
|
H A D | smatch_mtag_map.c | 34 sval_t sval; in match_assign() local 44 if (!get_implied_value(right, &sval)) in match_assign() 46 if (sval_cmp(sval, valid_ptr_min_sval) < 0 || in match_assign() 47 sval_cmp(sval, valid_ptr_max_sval) > 0) in match_assign() 49 right_tag = sval.uvalue & ~MTAG_OFFSET_MASK; in match_assign() 50 right_offset = sval.uvalue & MTAG_OFFSET_MASK; in match_assign()
|
H A D | smatch_parse_call_math.c | 170 sval_t sval; in read_var_num() local 178 sval.type = &llong_ctype; in read_var_num() 179 sval.value = strtoll(p, (char **)end, 10); in read_var_num() 182 *rl = alloc_rl(sval, sval); in read_var_num() 247 int parse_call_math(struct expression *call, char *math, sval_t *sval) in parse_call_math() argument 253 if (!rl_to_sval(rl, sval)) in parse_call_math() 347 static int is_mtag_sval(sval_t sval) in is_mtag_sval() argument 349 if (!is_ptr_type(sval.type)) in is_mtag_sval() 351 if (sval_cmp(sval, valid_ptr_min_sval) >= 0 && in is_mtag_sval() 352 sval_cmp(sval, valid_ptr_max_sval) <= 0) in is_mtag_sval() [all …]
|
H A D | smatch_constraints_required.c | 134 sval_t sval; in handle_zero_size_arrays() local 139 if (get_implied_value(mult_left, &sval) && in handle_zero_size_arrays() 140 sval.value == type_bytes(array_type)) in handle_zero_size_arrays() 142 else if (get_implied_value(mult_right, &sval) && in handle_zero_size_arrays() 143 sval.value == type_bytes(array_type)) in handle_zero_size_arrays() 166 sval_t sval; in match_alloc_helper() local 196 if (get_implied_value(mult_left, &sval) && in match_alloc_helper() 197 sval.value == bytes_per_element(pointer)) in match_alloc_helper() 199 else if (get_implied_value(mult_right, &sval) && in match_alloc_helper() 200 sval.value == bytes_per_element(pointer)) in match_alloc_helper() [all …]
|
H A D | check_index_overflow.c | 30 sval_t sval; in definitely_just_used_as_limiter() local 33 if (!get_implied_value(offset, &sval)) in definitely_just_used_as_limiter() 35 if (get_array_size(array) != sval.value) in definitely_just_used_as_limiter() 47 static int fake_get_hard_max(struct expression *expr, sval_t *sval) in fake_get_hard_max() argument 51 if (!get_hard_max(expr, sval)) in fake_get_hard_max() 64 sval_cmp(rl_max(implied_rl), *sval) < 0) in fake_get_hard_max() 65 *sval = rl_max(implied_rl); in fake_get_hard_max() 69 static int get_the_max(struct expression *expr, sval_t *sval) in get_the_max() argument 73 if (get_hard_max(expr, sval)) { in get_the_max() 86 sval_cmp(rl_max(implied_rl), *sval) < 0) in get_the_max() [all …]
|
H A D | smatch_capped.c | 97 sval_t sval; in is_capped() local 99 if (expr->op == '&' && !get_value(expr->right, &sval)) in is_capped() 104 !get_value(expr->right, &sval) && is_capped(expr->right)) in is_capped() 150 sval_t sval; in match_condition() local 163 if (get_implied_value(left, &sval) || in match_condition() 164 get_implied_value(right, &sval)) in match_condition() 222 sval_t sval; in match_caller_info() local 228 if (get_implied_value(tmp, &sval)) in match_caller_info() 239 sval_t sval; in struct_member_callback() local 244 if (estate_get_single_value(estate, &sval)) in struct_member_callback() [all …]
|
H A D | check_return_cast.c | 29 sval_t sval; in match_return() local 40 if (!get_fuzzy_min(ret_value, &sval)) in match_return() 42 if (sval_is_positive(sval) || sval_cmp_val(sval, -1) == 0) in match_return() 45 sm_warning("signedness bug returning '%s'", sval_to_str(sval)); in match_return()
|
H A D | check_debug.c | 122 sval_t sval; in match_print_known() local 125 if (get_value(arg, &sval)) in match_print_known() 131 …sm_msg("known: '%s' = '%s'. implied = '%s'", name, known ? sval_to_str(sval) : "<unknown>", show_… in match_print_known() 166 sval_t sval; in match_print_implied_min() local 172 if (get_implied_min(arg, &sval)) in match_print_implied_min() 173 sm_msg("implied min: %s = %s", name, sval_to_str(sval)); in match_print_implied_min() 183 sval_t sval; in match_print_implied_max() local 189 if (get_implied_max(arg, &sval)) in match_print_implied_max() 190 sm_msg("implied max: %s = %s", name, sval_to_str(sval)); in match_print_implied_max() 232 sval_t sval; in match_print_hard_max() local [all …]
|
H A D | check_allocating_enough_data.c | 25 sval_t sval; in db_returns_buf_size() local 37 if (!parse_call_math(call, math, &sval) || sval.value == 0) in db_returns_buf_size() 44 if (sval.uvalue >= bytes) in db_returns_buf_size() 48 sm_error("not allocating enough for = '%s' %d vs %s", str, bytes, sval_to_str(sval)); in db_returns_buf_size()
|
H A D | check_string_len.c | 44 sval_t sval; in handle_format() local 145 get_absolute_max(arg, &sval); in handle_format() 147 get_absolute_min(arg, &sval); in handle_format() 148 if (sval_is_negative(sval)) in handle_format() 149 sval.value = 0; in handle_format() 154 ret = snprintf(buf, sizeof(buf), "%llx", sval.uvalue); in handle_format() 156 ret = snprintf(buf, sizeof(buf), "%llu", sval.uvalue); in handle_format() 161 ret = snprintf(buf, sizeof(buf), "%lld", sval.value); in handle_format() 167 ret = snprintf(buf, sizeof(buf), "%lld", sval.value); in handle_format()
|
H A D | check_logical_instead_of_bitwise.c | 36 sval_t sval; in match_logic() local 44 if (!get_value(expr->right, &sval)) { in match_logic() 45 if (!get_value(expr->left, &sval)) in match_logic() 49 if (sval.value == 0 || sval.value == 1) in match_logic()
|
H A D | check_return_enomem.c | 33 sval_t sval; in match_return() local 41 if (!get_value(ret_value, &sval) || sval.value != -1) in match_return() 49 if (!estate_get_single_value(sm->state, &sval) || sval.value != 0) in match_return()
|
H A D | check_signed.c | 37 sval_t sval; in match_assign() local 54 if (!get_implied_value(expr->right, &sval)) in match_assign() 58 sval_cmp(max, sval) < 0 && in match_assign() 59 !(sval.value < 256 && max.value == 127)) { in match_assign() 63 right_name, sval_to_numstr(sval), sval_to_numstr(max), left_name); in match_assign() 67 if (sval_cmp_t(&llong_ctype, min, sval) > 0) { in match_assign() 68 if (min.value == 0 && sval.value == -1) /* assigning -1 to unsigned variables is idiomatic */ in match_assign() 74 if (sval_positive_bits(sval) == 7) in match_assign() 79 sval_to_str(sval), left_name); in match_assign() 82 sval_to_str(sval), sval_to_str(min), left_name); in match_assign()
|
H A D | check_capable.c | 29 sval_t sval; in match_capable() local 33 if (!get_implied_value(arg, &sval)) in match_capable() 35 snprintf(buf, sizeof(buf), "%s", sval_to_str(sval)); in match_capable() 42 sval_t sval; in match_ns_capable() local 49 if (!get_implied_value(arg, &sval)) in match_ns_capable() 51 snprintf(buf, sizeof(buf), "%s", sval_to_str(sval)); in match_ns_capable()
|
H A D | check_gfp_dma.c | 33 sval_t sval; in match_alloc() local 36 if (!get_value(arg_expr, &sval)) in match_alloc() 38 if (sval.uvalue == 0) /* GFP_NOWAIT */ in match_alloc() 40 if (!(sval.uvalue & ~GFP_ZONEMASK)) in match_alloc()
|
/illumos-gate/usr/src/cmd/awk/ |
H A D | tran.c | 108 if (&vp->sval == FS || &vp->sval == RS || in setfree() 109 &vp->sval == OFS || &vp->sval == ORS || in setfree() 110 &vp->sval == OFMT || &vp->sval == CONVFMT || in setfree() 111 &vp->sval == FILENAME || &vp->sval == SUBSEP) in setfree() 123 recloc->sval = record; in syminit() 133 FS = &fsloc->sval; in syminit() 135 RS = &rsloc->sval; in syminit() 138 OFS = &ofsloc->sval; in syminit() 140 ORS = &orsloc->sval; in syminit() 141 OFMT = &setsymtab("OFMT", "%.6g", 0.0, STR|DONTFREE, symtab)->sval; in syminit() [all …]
|
H A D | lib.c | 106 fldtab[0]->sval = record; in recinit() 221 xfree(recloc->sval); in getrec() 222 recloc->sval = buf; /* buf == record */ in getrec() 224 if (is_number(recloc->sval)) { in getrec() 226 atof(recloc->sval); in getrec() 374 if (is_number(q->sval)) { in setclvar() 375 q->fval = atof(q->sval); in setclvar() 396 r = fldtab[0]->sval; in fldbld() 420 xfree(fldtab[i]->sval); in fldbld() 421 fldtab[i]->sval = fr; in fldbld() [all …]
|
/illumos-gate/usr/src/cmd/oawk/ |
H A D | tran.c | 80 FS = &setsymtab(L_FS, tostring(L_space), 0.0, STR|FLD, symtab)->sval; in syminit() 81 RS = &setsymtab(L_RS, tostring(L_newline), 0.0, STR|FLD, symtab)->sval; in syminit() 82 OFS = &setsymtab(L_OFS, tostring(L_space), 0.0, STR|FLD, symtab)->sval; in syminit() 84 symtab)->sval; in syminit() 86 symtab)->sval; in syminit() 87 FILENAME = &setsymtab(L_FILENAME, NULL, 0.0, STR|FLD, symtab)->sval; in syminit() 120 tp = (CELL **) ap->sval; in freesymtab() 125 xfree(cp->sval); in freesymtab() 144 dprintf(" %ws %g %o\n", p->sval, p->fval, p->tval); in setsymtab() 151 p->sval = s; in setsymtab() [all …]
|
/illumos-gate/usr/src/test/libc-tests/tests/ |
H A D | strcoll-strxfrm-6907.c | 35 char sval[MAXSTRLEN]; member 58 p = data[i].sval; in main() 93 if (strxfrm(data[i].xval, data[i].sval, in main() 96 "exceeded %d bytes", (int)strlen(data[i].sval), in main() 106 int sr = strcoll(data[i].sval, data[j].sval); in main() 111 curloc, data[i].sval, data[j].sval); in main()
|