Skip to content

Commit 7fde971

Browse files
committed
Use pointee_align when storing sized indirect arguments, matching cg_llvm behavior
1 parent daf8bb9 commit 7fde971

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/intrinsic/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,9 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
734734
if self.is_ignore() {
735735
return;
736736
}
737-
if self.is_sized_indirect() {
738-
OperandValue::Ref(PlaceValue::new_sized(val, self.layout.align.abi)).store(bx, dst)
737+
if let PassMode::Indirect { attrs, meta_attrs: None, .. } = &self.mode {
738+
let align = attrs.pointee_align.unwrap_or(self.layout.align.abi);
739+
OperandValue::Ref(PlaceValue::new_sized(val, align)).store(bx, dst)
739740
} else if self.is_unsized_indirect() {
740741
bug!("unsized `ArgAbi` cannot be stored");
741742
} else if let PassMode::Cast { ref cast, .. } = self.mode {

0 commit comments

Comments
 (0)