History

Cast signed pointer offset to ptrdiff_t before performing arithmetic

Affects 32-bit platforms.

Aleksi Hannula committed 9 months ago

Commit 5ad52cc1 parent c9370951 file · +3 −0Browse files

Unified · Split

tccgen.c+3−0
@@ -3097,6 +3097,9 @@ op_err: · 3096 unmodified lines
3097#endif3097#endif
3098 type1 = vtop[-1].type;3098 type1 = vtop[-1].type;
3099 vpush_type_size(pointed_type(&vtop[-1].type), &align);3099 vpush_type_size(pointed_type(&vtop[-1].type), &align);
3100 if (!(vtop[-1].type.t & VT_UNSIGNED)) {
3101 gen_cast_s(VT_PTRDIFF_T);
3102 }
3100 gen_op('*');3103 gen_op('*');
3101#ifdef CONFIG_TCC_BCHECK3104#ifdef CONFIG_TCC_BCHECK
3102 if (tcc_state->do_bounds_check && !CONST_WANTED) {3105 if (tcc_state->do_bounds_check && !CONST_WANTED) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t