Skip to content

Commit

Permalink
Use dedicated method for getting the type size
Browse files Browse the repository at this point in the history
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
  • Loading branch information
oli-obk and nikic committed Oct 18, 2019
1 parent 88b5e94 commit 4a51801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {

"ptr_offset_from" => {
let ty = substs.type_at(0);
let pointee_size = self.layout_of(ty).size;
let pointee_size = self.size_of(ty);

// This is the same sequence that Clang emits for pointer subtraction.
// It can be neither `nsw` nor `nuw` because the input is treated as
Expand Down

0 comments on commit 4a51801

Please sign in to comment.