Directly return loaded value from type_checked_load
This commit is contained in:
parent
fff6296b62
commit
b2e0db93e7
@ -424,7 +424,9 @@ fn type_checked_load(
|
||||
typeid: &'ll Value,
|
||||
) -> Self::Value {
|
||||
let vtable_byte_offset = self.const_i32(vtable_byte_offset as i32);
|
||||
self.call_intrinsic("llvm.type.checked.load", &[llvtable, vtable_byte_offset, typeid])
|
||||
let type_checked_load =
|
||||
self.call_intrinsic("llvm.type.checked.load", &[llvtable, vtable_byte_offset, typeid]);
|
||||
self.extract_value(type_checked_load, 0)
|
||||
}
|
||||
|
||||
fn va_start(&mut self, va_list: &'ll Value) -> &'ll Value {
|
||||
|
@ -31,8 +31,7 @@ pub fn get_fn<Bx: BuilderMethods<'a, 'tcx>>(
|
||||
let typeid =
|
||||
bx.typeid_metadata(typeid_for_trait_ref(bx.tcx(), expect_dyn_trait_in_self(ty)));
|
||||
let vtable_byte_offset = self.0 * bx.data_layout().pointer_size.bytes();
|
||||
let type_checked_load = bx.type_checked_load(llvtable, vtable_byte_offset, typeid);
|
||||
let func = bx.extract_value(type_checked_load, 0);
|
||||
let func = bx.type_checked_load(llvtable, vtable_byte_offset, typeid);
|
||||
bx.pointercast(func, llty)
|
||||
} else {
|
||||
let ptr_align = bx.tcx().data_layout.pointer_align.abi;
|
||||
|
Loading…
Reference in New Issue
Block a user