History

fix vstack leak

I think this code only affects the ARM EABI target, and only when returning small structures that might be unaligned. However, it was both leaking vstack entries and failing to achieve what I think is its purpose, to ensure the sret argument would be aligned properly. Both issues fixed.

Philip committed 11 years ago

Commit 41260561 parent 44c330d1 file · +2 −1Browse files

Unified · Split

tccgen.c+2−1
@@ -4916,12 +4916,13 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 4915 unmodified lines
49164916 size = type_size(&func_vt,&align);
49174917 if ((vtop->r != (VT_LOCAL | VT_LVAL) || (vtop->c.i & (ret_align-1)))
49184918 && (align & (ret_align-1))) {
4919− loc = (loc - size) & -align;
4919+ loc = (loc - size) & -ret_align;
49204920 addr = loc;
49214921 type = func_vt;
49224922 vset(&type, VT_LOCAL | VT_LVAL, addr);
49234923 vswap();
49244924 vstore();
4925+ vpop();
49254926 vset(&ret_type, VT_LOCAL | VT_LVAL, addr);
49264927 }
49274928 vtop->type = ret_type;

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