amd64: avoid reading past end of passed struct
If the size of the struct is not a multiple of 8, the actual struct size may be different from the size reserved on the stack. This fixes the case where the struct is passed in memory, but we still may over-read a struct passed in registers. A TODO is added for now.
This commit is contained in:
parent
cd095a44db
commit
ae8803cbe6
2 changed files with 9 additions and 2 deletions
|
@ -144,6 +144,7 @@ sttmps(Ref tmp[], int cls[], uint nreg, Ref mem, Fn *fn)
|
|||
}
|
||||
}
|
||||
|
||||
/* todo, may read out of bounds */
|
||||
static void
|
||||
ldregs(int reg[], int cls[], int n, Ref mem, Fn *fn)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue