Skip to content

Commit

Permalink
Use offset instead of index
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Dec 11, 2024
1 parent 2547971 commit f89b192
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_codegen_ssa/src/mir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
layout.size
};

let llval = bx.inbounds_gep(bx.cx().backend_type(self.layout), self.val.llval, &[
bx.cx().const_usize(0),
llindex,
]);
let llval = bx.inbounds_gep(bx.cx().backend_type(layout), self.val.llval, &[llindex]);
let align = self.val.align.restrict_for_offset(offset);
PlaceValue::new_sized(llval, align).with_type(layout)
}
Expand Down

0 comments on commit f89b192

Please sign in to comment.