mirror of
git://repo.or.cz/tinycc.git
synced 2026-07-02 01:28:39 +08:00
Cast signed pointer offset to ptrdiff_t before performing arithmetic
Affects 32-bit platforms.
This commit is contained in:
parent
c937095552
commit
5ad52cc1ed
3
tccgen.c
3
tccgen.c
@ -3097,6 +3097,9 @@ op_err:
|
|||||||
#endif
|
#endif
|
||||||
type1 = vtop[-1].type;
|
type1 = vtop[-1].type;
|
||||||
vpush_type_size(pointed_type(&vtop[-1].type), &align);
|
vpush_type_size(pointed_type(&vtop[-1].type), &align);
|
||||||
|
if (!(vtop[-1].type.t & VT_UNSIGNED)) {
|
||||||
|
gen_cast_s(VT_PTRDIFF_T);
|
||||||
|
}
|
||||||
gen_op('*');
|
gen_op('*');
|
||||||
#ifdef CONFIG_TCC_BCHECK
|
#ifdef CONFIG_TCC_BCHECK
|
||||||
if (tcc_state->do_bounds_check && !CONST_WANTED) {
|
if (tcc_state->do_bounds_check && !CONST_WANTED) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user