diff options
| author | Graydon Hoare <[email protected]> | 2010-09-27 14:42:58 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-27 14:42:58 -0700 |
| commit | a2f4d9089a413842c96e14e66462577bf14e76fb (patch) | |
| tree | d9d1455929ca5364b63fd898abcc4f1b52b765aa /src/comp/back | |
| parent | First linkable and executable translation from rustc. Upcalls to log, passes ... (diff) | |
| download | rust-a2f4d9089a413842c96e14e66462577bf14e76fb.tar.xz rust-a2f4d9089a413842c96e14e66462577bf14e76fb.zip | |
Fix indexing bug in rustc's indirect-upcall arg-copying loops.
Diffstat (limited to 'src/comp/back')
| -rw-r--r-- | src/comp/back/x86.rs | 7 |
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"); } |