Fix LLVM type of load of table entry.

This commit is contained in:
Nick Lewycky
2020-05-18 13:17:24 -07:00
parent 3c4b8a9777
commit f666a394c5

View File

@@ -952,6 +952,7 @@ impl<'ctx, 'a> CtxType<'ctx, 'a> {
);
let ptr_to_bounds =
unsafe { cache_builder.build_gep(ctx_ptr_value, &[offset], "") };
let ptr_to_bounds = cache_builder.build_bitcast(ptr_to_bounds, intrinsics.i32_ptr_ty, "").into_pointer_value();
(ptr_to_base_ptr, ptr_to_bounds)
} else {
let offset = intrinsics.i64_ty.const_int(
@@ -989,6 +990,7 @@ impl<'ctx, 'a> CtxType<'ctx, 'a> {
.const_int(offsets.vmtable_definition_current_elements().into(), false);
let ptr_to_bounds =
unsafe { cache_builder.build_gep(definition_ptr, &[offset], "") };
let ptr_to_bounds = cache_builder.build_bitcast(ptr_to_bounds, intrinsics.i32_ptr_ty, "").into_pointer_value();
(ptr_to_base_ptr, ptr_to_bounds)
};
TableCache {