Skip to content

Commit e8861d6

Browse files
committed
---
yaml --- r: 23508 b: refs/heads/master c: 62be878 h: refs/heads/master v: v3
1 parent 5342288 commit e8861d6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ff9151fa55e4e81c0cbaa7181eb672b2df6b53f6
2+
refs/heads/master: 62be878ed1715650f080c3b113a85f73e7af0973
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/rustc/middle/trans/foreign.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,12 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::foreign_item,
937937
ty_to_str(ccx.tcx, substs.tys[1]), out_sz));
938938
}
939939
if !ty::type_is_nil(substs.tys[1]) {
940-
let cast = PointerCast(bcx, get_param(decl, first_real_arg),
941-
T_ptr(llout_ty));
942-
Store(bcx, Load(bcx, cast), fcx.llretptr);
940+
// NB: Do not use a Load and Store here. This causes massive code
941+
// bloat when reinterpret_cast is used on large structural types.
942+
let llretptr = PointerCast(bcx, fcx.llretptr, T_ptr(T_i8()));
943+
let llcast = get_param(decl, first_real_arg);
944+
let llcast = PointerCast(bcx, llcast, T_ptr(T_i8()));
945+
call_memmove(bcx, llretptr, llcast, llsize_of(ccx, lltp_ty));
943946
}
944947
}
945948
~"addr_of" => {

0 commit comments

Comments
 (0)