Skip to content

Commit 28bd3bb

Browse files
committed
---
yaml --- r: 4412 b: refs/heads/master c: ae33120 h: refs/heads/master v: v3
1 parent ae48874 commit 28bd3bb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
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: e0985c10606d0b38be66734bf1a34bad70eec064
2+
refs/heads/master: ae3312002a87d673ae97a9e75455060fcd111069

trunk/src/comp/middle/trans.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,7 +2380,7 @@ fn call_memmove(cx: &@block_ctxt, dst: ValueRef, src: ValueRef,
23802380
let src_ptr = cx.build.PointerCast(src, T_ptr(T_i8()));
23812381
let dst_ptr = cx.build.PointerCast(dst, T_ptr(T_i8()));
23822382
let size = cx.build.IntCast(n_bytes, T_i32());
2383-
let align = C_int(0);
2383+
let align = C_int(1);
23842384
let volatile = C_bool(false);
23852385
ret rslt(cx,
23862386
cx.build.Call(memmove,
@@ -2411,7 +2411,12 @@ fn memmove_ty(cx: &@block_ctxt, dst: ValueRef, src: ValueRef, t: &ty::t) ->
24112411
if ty::type_has_dynamic_size(bcx_tcx(cx), t) {
24122412
let llsz = size_of(cx, t);
24132413
ret call_memmove(llsz.bcx, dst, src, llsz.val);
2414-
} else { ret rslt(cx, cx.build.Store(cx.build.Load(src), dst)); }
2414+
} else if ty::type_is_structural(bcx_tcx(cx), t) {
2415+
let llsz = llsize_of(type_of(bcx_ccx(cx), cx.sp, t));
2416+
ret call_memmove(cx, dst, src, llsz);
2417+
} else {
2418+
ret rslt(cx, cx.build.Store(cx.build.Load(src), dst));
2419+
}
24152420
}
24162421

24172422
// Duplicates any heap-owned memory owned by a value of the given type.

0 commit comments

Comments
 (0)