Skip to content

Commit e64137c

Browse files
committed
Tolerate non-ptr indirect scalars in codegen.
1 parent f18b222 commit e64137c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_codegen_ssa/src/mir/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
159159
Abi::Scalar(s @ abi::Scalar::Initialized { .. }) => {
160160
let size = s.size(bx);
161161
assert_eq!(size, layout.size, "abi::Scalar size does not match layout size");
162-
let val = read_scalar(Size::ZERO, size, s, bx.type_ptr());
162+
let val = read_scalar(Size::ZERO, size, s, bx.backend_type(layout));
163163
OperandRef { val: OperandValue::Immediate(val), layout }
164164
}
165165
Abi::ScalarPair(

0 commit comments

Comments
 (0)