Skip to content

Commit 376cfa9

Browse files
committed
---
yaml --- r: 1677 b: refs/heads/master c: 9dc3f3f h: refs/heads/master i: 1675: 7f74c78 v: v3
1 parent ac2ddde commit 376cfa9

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 54587bdccb7b6771cfc704a30fc0ef2c65824a15
2+
refs/heads/master: 9dc3f3f18371144daef8cfadb0bb9fce61c7b463

trunk/src/comp/back/x86.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ fn upcall_glue(int n_args) -> vec[str] {
212212
+ store_esp_to_rust_sp_second_arg()
213213
+ load_esp_from_runtime_sp_second_arg()
214214

215-
+ vec("subl $" + wstr(n_args + 1) + ", %esp # esp -= args",
215+
+ vec("subl $" + wstr(n_args) + ", %esp # esp -= args",
216216
"andl $~0xf, %esp # align esp down")
217217

218-
+ _vec.init_fn[str](carg, (n_args + 1) as uint)
218+
+ _vec.init_fn[str](carg, (n_args) as uint)
219219

220220
+ vec("movl %edx, %edi # save task from edx to edi",
221221
"call *%ecx # call *%ecx",
@@ -268,7 +268,7 @@ fn get_module_asm() -> str {
268268
rust_yield_glue()))
269269

270270
+ _vec.init_fn[str](bind decl_upcall_glue(align, prefix, _),
271-
abi.n_upcall_glues as uint);
271+
(abi.n_upcall_glues + 1) as uint);
272272

273273
ret _str.connect(glues, "\n\n");
274274
}

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,7 @@ fn decl_upcall_glue(ModuleRef llmod, type_names tn, uint _n) -> ValueRef {
832832
let int n = _n as int;
833833
let str s = abi.upcall_glue_name(n);
834834
let vec[TypeRef] args =
835-
vec(T_int(), // callee
836-
T_int()) // taskptr
835+
vec(T_int()) // callee
837836
+ _vec.init_elt[TypeRef](T_int(), n as uint);
838837

839838
ret decl_fastcall_fn(llmod, s, T_fn(args, T_int()));
@@ -864,7 +863,7 @@ fn trans_upcall2(builder b, @glue_fns glues, ValueRef lltaskptr,
864863
&hashmap[str, ValueRef] upcalls,
865864
type_names tn, ModuleRef llmod, str name,
866865
vec[ValueRef] args) -> ValueRef {
867-
let int n = _vec.len[ValueRef](args) as int;
866+
let int n = (_vec.len[ValueRef](args) as int) + 1;
868867
let ValueRef llupcall = get_upcall(upcalls, tn, llmod, name, n);
869868
llupcall = llvm.LLVMConstPointerCast(llupcall, T_int());
870869

@@ -6098,7 +6097,7 @@ fn make_glues(ModuleRef llmod, type_names tn) -> @glue_fns {
60986097

60996098
upcall_glues =
61006099
_vec.init_fn[ValueRef](bind decl_upcall_glue(llmod, tn, _),
6101-
abi.n_upcall_glues as uint),
6100+
abi.n_upcall_glues + 1 as uint),
61026101
no_op_type_glue = decl_no_op_type_glue(llmod, tn),
61036102
memcpy_glue = decl_memcpy_glue(llmod),
61046103
bzero_glue = decl_bzero_glue(llmod),

0 commit comments

Comments
 (0)