Skip to content

Commit 822edd8

Browse files
committed
---
yaml --- r: 5637 b: refs/heads/master c: dcf0e80 h: refs/heads/master i: 5635: bf63db6 v: v3
1 parent 8410b76 commit 822edd8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
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: 472dd71fea8d1bb99e3c896d149323ab88cc1344
2+
refs/heads/master: dcf0e807fbc46142859d0b0b0de0bfba4edce4c8

trunk/src/comp/middle/trans.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4029,7 +4029,15 @@ fn trans_c_stack_native_call(bcx: @block_ctxt, f: @ast::expr,
40294029
let ret_ty = ty::ty_fn_ret(bcx_tcx(bcx), fn_ty);
40304030
check type_has_static_size(ccx, ret_ty);
40314031
let llretty = type_of(ccx, f.span, ret_ty);
4032-
let llretval = TruncOrBitCast(bcx, llrawretval, llretty);
4032+
log_err "casting " + val_str(ccx.tn, llrawretval) + " to " +
4033+
lib::llvm::type_to_str(ccx.tn, llretty);
4034+
4035+
let llretval;
4036+
if lib::llvm::llvm::LLVMGetTypeKind(llretty) as int == 11 { // pointer
4037+
llretval = IntToPtr(bcx, llrawretval, llretty);
4038+
} else {
4039+
llretval = TruncOrBitCast(bcx, llrawretval, llretty);
4040+
}
40334041

40344042
// Forget about anything we moved out.
40354043
bcx = zero_and_revoke(bcx, to_zero, to_revoke);

0 commit comments

Comments
 (0)