aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-27 14:42:58 -0700
committerGraydon Hoare <[email protected]>2010-09-27 14:42:58 -0700
commita2f4d9089a413842c96e14e66462577bf14e76fb (patch)
treed9d1455929ca5364b63fd898abcc4f1b52b765aa /src
parentFirst linkable and executable translation from rustc. Upcalls to log, passes ... (diff)
downloadrust-a2f4d9089a413842c96e14e66462577bf14e76fb.tar.xz
rust-a2f4d9089a413842c96e14e66462577bf14e76fb.zip
Fix indexing bug in rustc's indirect-upcall arg-copying loops.
Diffstat (limited to 'src')
-rw-r--r--src/comp/back/x86.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/comp/back/x86.rs b/src/comp/back/x86.rs
index b3edcae6..d4b76352 100644
--- a/src/comp/back/x86.rs
+++ b/src/comp/back/x86.rs
@@ -75,9 +75,10 @@ fn upcall_glue(int n_args) -> vec[str] {
*/
fn copy_arg(uint i) -> str {
- auto off = wstr(7 + (i as int));
- auto m = vec("movl " + off + "(%ebp),%edx",
- "movl %edx," + off + "(%esp)");
+ auto src_off = wstr(7 + (i as int));
+ auto dst_off = wstr(1 + (i as int));
+ auto m = vec("movl " + src_off + "(%ebp),%edx",
+ "movl %edx," + dst_off + "(%esp)");
ret _str.connect(m, "\n\t");
}