Skip to content

Commit 844b5cf

Browse files
committed
auto merge of #6794 : thestinger/rust/align_zero, r=pcwalton
This is unlikely to alter optimized codegen much but there's no point in downgrading the known alignment to 1.
2 parents e3e55c5 + 9ab2921 commit 844b5cf

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)