Skip to content

Commit

Permalink
Update compiler/rustc_codegen_ssa/src/mir/place.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix authored Dec 16, 2022
1 parent 67d2c9f commit 4d803a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/mir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
self.llval
} else {
let byte_ptr = bx.pointercast(self.llval, bx.cx().type_i8p());
// FIXME(eddyb) when can this not be `inbounds`? ZSTs?
// (but since `offset` is larger than `0`, that would mean the
// This is always `inbounds`. For example, ZSTs cannot arise
// because `offset` is larger than `0`, which means the
// allocation the place points into has at least one byte, so
// any possible offset in the layout *should* be in-bounds)
bx.inbounds_gep(bx.cx().type_i8(), byte_ptr, &[bx.const_usize(offset.bytes())])
Expand Down

0 comments on commit 4d803a0

Please sign in to comment.