Skip to content

Commit 9ab2921

Browse files
committed
use the type's alignment for generated memsets
1 parent d7e1f08 commit 9ab2921

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ pub fn memzero(cx: block, llptr: ValueRef, llty: TypeRef) {
15061506
let llptr = PointerCast(cx, llptr, T_ptr(T_i8()));
15071507
let llzeroval = C_u8(0);
15081508
let size = IntCast(cx, machine::llsize_of(ccx, llty), ccx.int_type);
1509-
let align = C_i32(1i32);
1509+
let align = C_i32(llalign_of_min(ccx, llty) as i32);
15101510
let volatile = C_i1(false);
15111511
Call(cx, llintrinsicfn, [llptr, llzeroval, size, align, volatile]);
15121512
}

0 commit comments

Comments
 (0)