@@ -7074,14 +7074,25 @@ fn trans_exit_task_glue(@glue_fns glues,
7074
7074
let vec[ ValueRef ] V_args = vec ( ) ;
7075
7075
7076
7076
auto llfn = glues. exit_task_glue ;
7077
- let ValueRef lltaskptr = llvm. LLVMGetParam ( llfn, 4 u) ;
7078
7077
7079
7078
auto entrybb = llvm. LLVMAppendBasicBlock ( llfn, _str. buf ( "entry" ) ) ;
7080
7079
auto build = new_builder ( entrybb) ;
7081
- auto tptr = build. PtrToInt ( lltaskptr, T_int ( ) ) ;
7082
- auto V_args2 = vec ( tptr) + V_args ;
7083
- trans_native_call ( build, glues, lltaskptr,
7084
- externs, tn, llmod, "upcall_exit" , true , V_args2 ) ;
7080
+
7081
+ let ValueRef arg1 = llvm. LLVMGetParam ( llfn, 0 u) ;
7082
+ let ValueRef arg2 = llvm. LLVMGetParam ( llfn, 1 u) ;
7083
+ let ValueRef arg3 = llvm. LLVMGetParam ( llfn, 2 u) ;
7084
+ let ValueRef arg4 = llvm. LLVMGetParam ( llfn, 3 u) ;
7085
+ let ValueRef arg5 = llvm. LLVMGetParam ( llfn, 4 u) ;
7086
+
7087
+ auto main_type = T_fn ( vec ( T_int ( ) , T_int ( ) , T_int ( ) , T_int ( ) ) , T_void ( ) ) ;
7088
+
7089
+ auto fun = build. IntToPtr ( arg1, T_ptr ( main_type) ) ;
7090
+ auto call_args = vec ( arg2, arg3, arg4, arg5) ;
7091
+ build. FastCall ( fun, call_args) ;
7092
+
7093
+ trans_native_call ( build, glues, arg3,
7094
+ externs, tn, llmod, "upcall_exit" , true , vec ( arg3) ) ;
7095
+
7085
7096
build. RetVoid ( ) ;
7086
7097
}
7087
7098
@@ -7524,22 +7535,12 @@ fn trans_vec_append_glue(@local_ctxt cx) {
7524
7535
fn make_glues ( ModuleRef llmod, type_names tn) -> @glue_fns {
7525
7536
ret @rec( activate_glue = decl_glue ( llmod, tn, abi. activate_glue_name ( ) ) ,
7526
7537
yield_glue = decl_glue ( llmod, tn, abi. yield_glue_name ( ) ) ,
7527
- /*
7528
- * Note: the signature passed to decl_cdecl_fn here looks unusual
7529
- * because it is. It corresponds neither to a native signature
7530
- * nor a normal rust-ABI signature. In fact it is a fake
7531
- * signature, that exists solely to acquire the task pointer as
7532
- * an argument to the upcall. It so happens that the runtime sets
7533
- * up the task pointer as the sole incoming argument to the frame
7534
- * that we return into when returning to the exit task glue. So
7535
- * this is the signature required to retrieve it.
7536
- */
7537
7538
exit_task_glue = decl_cdecl_fn ( llmod, abi. exit_task_glue_name ( ) ,
7538
7539
T_fn ( vec ( T_int ( ) ,
7539
7540
T_int ( ) ,
7540
7541
T_int ( ) ,
7541
7542
T_int ( ) ,
7542
- T_taskptr ( tn ) ) ,
7543
+ T_int ( ) ) ,
7543
7544
T_void ( ) ) ) ,
7544
7545
7545
7546
native_glues_rust =
0 commit comments