Skip to content

Commit 6992405

Browse files
committed
Tolerate non-ptr indirect scalars in codegen.
1 parent 3050938 commit 6992405

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
@@ -156,7 +156,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
156156
Abi::Scalar(s @ abi::Scalar::Initialized { .. }) => {
157157
let size = s.size(bx);
158158
assert_eq!(size, layout.size, "abi::Scalar size does not match layout size");
159-
let val = read_scalar(Size::ZERO, size, s, bx.type_ptr());
159+
let val = read_scalar(Size::ZERO, size, s, bx.backend_type(layout));
160160
OperandRef { val: OperandValue::Immediate(val), layout }
161161
}
162162
Abi::ScalarPair(

0 commit comments

Comments
 (0)