Skip to content

Commit a2f4d90

Browse files
committed
Fix indexing bug in rustc's indirect-upcall arg-copying loops.
1 parent d31eca4 commit a2f4d90

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/comp/back/x86.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ fn upcall_glue(int n_args) -> vec[str] {
7575
*/
7676

7777
fn copy_arg(uint i) -> str {
78-
auto off = wstr(7 + (i as int));
79-
auto m = vec("movl " + off + "(%ebp),%edx",
80-
"movl %edx," + off + "(%esp)");
78+
auto src_off = wstr(7 + (i as int));
79+
auto dst_off = wstr(1 + (i as int));
80+
auto m = vec("movl " + src_off + "(%ebp),%edx",
81+
"movl %edx," + dst_off + "(%esp)");
8182
ret _str.connect(m, "\n\t");
8283
}
8384

0 commit comments

Comments
 (0)