From ae8803cbe655f64a2ef1739c8dfc5c12af99bdfb Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 25 Sep 2021 13:27:27 -0700 Subject: 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. --- arm64/abi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arm64') diff --git a/arm64/abi.c b/arm64/abi.c index f37c892..db794f6 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -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) { -- cgit 1.4.1