Use dedicated method for getting the type size

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
This commit is contained in:
Oliver Scherer 2019-10-18 12:21:09 +02:00 committed by GitHub
parent 88b5e945e0
commit 4a51801c39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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