summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-01-29 09:15:54 -0800
committerOri Bernstein <ori@eigenstate.org>2019-01-29 09:15:54 -0800
commit9b864a2bc7fbdae40704708a6893e6f29ad48397 (patch)
treef0c9c9d495afeb4f807868e2c4299ded1cafc939
parentbb49af4578c4a1f31beee9da6d868e859697d1bc (diff)
downloadmc-9b864a2bc7fbdae40704708a6893e6f29ad48397.tar.gz
Align slices correctly in vaenter.
-rw-r--r--lib/std/varargs.myr13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/std/varargs.myr b/lib/std/varargs.myr
index f715b7c..6f5aa30 100644
--- a/lib/std/varargs.myr
+++ b/lib/std/varargs.myr
@@ -147,11 +147,18 @@ const addp = {p, k
-> ((p : intptr) + k : byte#)
}
-const sliceptr = {p
+const sliceptr = {pp
+ var p
+
+ p = (pp : intptr)
+ p = (p + 0x7) & ~0x7
-> (p : byte##)#
}
-const slicelen = {p
- p = addp(p, sizeof(intptr))
+const slicelen = {pp
+ var p
+
+ p = (pp : intptr)
+ p = (p + 0xf) & ~0x7
-> (p : size#)#
}