Skip to content

Commit 0c47fdf

Browse files
committed
Cast vtable type too
1 parent 43499da commit 0c47fdf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

+1
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
286286
bug!("Only valid to do a DynStar cast into a DynStar type")
287287
};
288288
let vtable = get_vtable(bx.cx(), source.ty(self.mir, bx.tcx()), trait_ref);
289+
let vtable = bx.pointercast(vtable, bx.cx().type_ptr_to(bx.cx().type_isize()));
289290
let data = match operand.layout.pointee_info_at(bx.cx(), Size::ZERO) {
290291
Some(_) => bx.ptrtoint(data, bx.cx().type_isize()),
291292
None => data,

0 commit comments

Comments
 (0)