Skip to content

Commit 1c0a5b0

Browse files
committed
Use LLVM bitcast instructions rather than pointercasts to avoid address space mismatch problems
This was suggested by @eddyb on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Better.20supporting.20Harvard.20architectures/near/202043069 Bitcasts do not suffer from the same address space casting issues.
1 parent d462551 commit 1c0a5b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_codegen_llvm/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
693693
}
694694

695695
fn pointercast(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
696-
unsafe { llvm::LLVMBuildPointerCast(self.llbuilder, val, dest_ty, UNNAMED) }
696+
self.bitcast(val, dest_ty)
697697
}
698698

699699
/* Comparisons */

0 commit comments

Comments
 (0)