about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2022-10-07 13:05:45 -0700
committerEric Holk <ericholk@microsoft.com>2022-10-07 13:05:45 -0700
commit0c47fdfedbb44256b3c78f315cd6150190317e38 (patch)
tree9c6b47a16d1894edb4021e76741637f4dda034b6
parent43499da7539d4d0f6bfcea14e19cbe3d7dda4777 (diff)
downloadrust-0c47fdfedbb44256b3c78f315cd6150190317e38.tar.gz
rust-0c47fdfedbb44256b3c78f315cd6150190317e38.zip
Cast vtable type too
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/rvalue.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
index c8ff26f74e3..5837b4ff2b9 100644
--- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
@@ -286,6 +286,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                                 bug!("Only valid to do a DynStar cast into a DynStar type")
                             };
                         let vtable = get_vtable(bx.cx(), source.ty(self.mir, bx.tcx()), trait_ref);
+                        let vtable = bx.pointercast(vtable, bx.cx().type_ptr_to(bx.cx().type_isize()));
                         let data = match operand.layout.pointee_info_at(bx.cx(), Size::ZERO) {
                             Some(_) => bx.ptrtoint(data, bx.cx().type_isize()),
                             None => data,