1
Fork 0

Auto merge of #119056 - cjgillot:codegen-overalign, r=wesleywiser

Tolerate overaligned MIR constants for codegen.

Fixes https://github.com/rust-lang/rust/issues/117761

cc `@saethlin`
This commit is contained in:
bors 2023-12-21 04:01:36 +00:00
commit 920e0051cf
2 changed files with 37 additions and 1 deletions

View file

@ -132,7 +132,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
offset: Size,
) -> Self {
let alloc_align = alloc.inner().align;
assert_eq!(alloc_align, layout.align.abi);
assert!(alloc_align >= layout.align.abi);
let read_scalar = |start, size, s: abi::Scalar, ty| {
match alloc.0.read_scalar(