summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-03-26 22:06:47 -0700
committerOri Bernstein <ori@eigenstate.org>2015-03-26 22:46:57 -0700
commita52816a45ffc93ae0c913c9dde33943f77991ede (patch)
treedb54651cc5959ed9defde686daaa36aeaf409521 /libstd
parent7a946573a2c3edc352c95a356373d1e1174c490f (diff)
downloadmc-a52816a45ffc93ae0c913c9dde33943f77991ede.tar.gz
Generate type descriptions for valists.
the formatting test is still broken, but everything else seems to be working.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/syscall+linux-x64.s13
-rw-r--r--libstd/varargs.myr5
2 files changed, 11 insertions, 7 deletions
diff --git a/libstd/syscall+linux-x64.s b/libstd/syscall+linux-x64.s
index 7e639eb..d1a3086 100644
--- a/libstd/syscall+linux-x64.s
+++ b/libstd/syscall+linux-x64.s
@@ -9,6 +9,7 @@ sys$syscall:
pushq %r9
pushq %rcx
pushq %r11
+
/*
hack: We load 6 args regardless of
how many we actually have. This may
@@ -17,12 +18,12 @@ sys$syscall:
harmless.
*/
movq 80 (%rsp),%rax
- movq 88 (%rsp),%rdi
- movq 96 (%rsp),%rsi
- movq 104(%rsp),%rdx
- movq 112(%rsp),%r10
- movq 120(%rsp),%r8
- movq 128(%rsp),%r9
+ movq 96 (%rsp),%rdi
+ movq 104(%rsp),%rsi
+ movq 112(%rsp),%rdx
+ movq 120(%rsp),%r10
+ movq 128(%rsp),%r8
+ movq 136(%rsp),%r9
syscall
diff --git a/libstd/varargs.myr b/libstd/varargs.myr
index bcaac76..99d04d3 100644
--- a/libstd/varargs.myr
+++ b/libstd/varargs.myr
@@ -19,7 +19,10 @@ type valist = byte#
* force varargs onto the stack regardless.
*/
const vastart = {args
- -> args castto(valist)
+ var ap, dump : byte#
+
+ (dump, ap) = vanext(args castto(valist))
+ -> ap
}
generic vanext = {ap -> (@a, valist)