Skip to content

Commit 1d6e62e

Browse files
committed
Fixes ICE in sparc64 ABI (Issue rust-lang#115399)
1 parent 0a83e43 commit 1d6e62e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

compiler/rustc_target/src/abi/call/sparc64.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn parse_structure<'a, Ty, C>(
9898
cx: &C,
9999
layout: TyAndLayout<'a, Ty>,
100100
mut data: Sdata,
101-
mut offset: Size,
101+
offset: Size,
102102
) -> Sdata
103103
where
104104
Ty: TyAbiInterface<'a, C> + Copy,
@@ -115,9 +115,15 @@ where
115115
abi::Abi::Aggregate { .. } => {
116116
for i in 0..layout.fields.count() {
117117
if offset < layout.fields.offset(i) {
118-
offset = layout.fields.offset(i);
118+
data = parse_structure(
119+
cx,
120+
layout.field(cx, i),
121+
data.clone(),
122+
layout.fields.offset(i),
123+
);
124+
} else {
125+
data = parse_structure(cx, layout.field(cx, i), data.clone(), offset);
119126
}
120-
data = parse_structure(cx, layout.field(cx, i), data.clone(), offset);
121127
}
122128
}
123129
_ => {

0 commit comments

Comments
 (0)