summary refs log tree commit diff
path: root/arm64/abi.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-09-25 13:27:27 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2021-11-08 14:11:10 +0100
commitae8803cbe655f64a2ef1739c8dfc5c12af99bdfb (patch)
treead526ee40568cc5ac7642ad677b69c69d3315377 /arm64/abi.c
parentcd095a44db262351b09ea144a44b76e22d62c77a (diff)
downloadroux-ae8803cbe655f64a2ef1739c8dfc5c12af99bdfb.tar.gz
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.
Diffstat (limited to 'arm64/abi.c')
-rw-r--r--arm64/abi.c1
1 files changed, 1 insertions, 0 deletions
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)
 {