summaryrefslogtreecommitdiff
path: root/pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-10-26 19:34:26 -0700
committerMichael Forney <mforney@mforney.org>2021-10-26 20:00:12 -0700
commit066e68c4fe79238bc3377dea38585eb56b5934b1 (patch)
treebc9f19c998b92f7f866f35649fa4084d25539fe3 /pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch
parentf8b20538cc063224c6a1a2a8a65fbaa5e87c3f3c (diff)
qbe: Update to latest git and tweak some patches
Diffstat (limited to 'pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch')
-rw-r--r--pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch b/pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch
new file mode 100644
index 00000000..ca21a84f
--- /dev/null
+++ b/pkg/qbe/patch/0001-arm64-prevent-stack-clobber-when-passing-structures-.patch
@@ -0,0 +1,33 @@
+From 6c1744026545445511f1c500653bab859bc79b50 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 11 May 2019 19:38:13 -0700
+Subject: [PATCH] arm64: prevent stack clobber when passing structures < 8
+ bytes
+
+---
+ arm64/abi.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arm64/abi.c b/arm64/abi.c
+index 8209944..f37c892 100644
+--- a/arm64/abi.c
++++ b/arm64/abi.c
+@@ -312,12 +312,14 @@ stkblob(Ref r, Class *c, Fn *fn, Insl **ilp)
+ {
+ Insl *il;
+ int al;
++ uint64_t sz;
+
+ il = alloc(sizeof *il);
+ al = c->t->align - 2; /* NAlign == 3 */
+ if (al < 0)
+ al = 0;
+- il->i = (Ins){Oalloc+al, Kl, r, {getcon(c->t->size, fn)}};
++ sz = c->class & Cptr ? c->t->size : c->size;
++ il->i = (Ins){Oalloc+al, Kl, r, {getcon(sz, fn)}};
+ il->link = *ilp;
+ *ilp = il;
+ }
+--
+2.32.0
+