Fix stack overwrite on structure return

The common code to move a returned structure packed into
registers into memory on the caller side didn't take the
register size into account when allocating local storage,
so sometimes that lead to stack overwrites (e.g. in 73_arm64.c),
on x86_64.  This fixes it by generally making gfunc_sret also return
the register size.
This commit is contained in:
Michael Matz
2015-03-09 00:19:59 +01:00
parent d73b488401
commit 50899e30ab
7 changed files with 26 additions and 17 deletions

View File

@ -1196,7 +1196,7 @@ ST_FUNC void gen_va_arg(CType *t)
}
}
ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *align)
ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *align, int *regsize)
{
return 0;
}