parent
ece98a4b41
commit
ab836ca5e3
2 changed files with 21 additions and 1 deletions
|
@ -155,12 +155,25 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
foo(I64X2(0, 0));
|
foo(I64X2(0, 0));
|
||||||
|
|
||||||
|
transmute_fat_pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn panic(_: u128) {
|
fn panic(_: u128) {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use std::mem::transmute;
|
||||||
|
|
||||||
|
#[cfg(target_pointer_width = "32")]
|
||||||
|
type TwoPtrs = i64;
|
||||||
|
#[cfg(target_pointer_width = "64")]
|
||||||
|
type TwoPtrs = i128;
|
||||||
|
|
||||||
|
fn transmute_fat_pointer() -> TwoPtrs {
|
||||||
|
unsafe { transmute::<_, TwoPtrs>("true !") }
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(simd)]
|
#[repr(simd)]
|
||||||
struct I64X2(i64, i64);
|
struct I64X2(i64, i64);
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,14 @@ impl<'tcx> CPlace<'tcx> {
|
||||||
let dst_layout = self.layout();
|
let dst_layout = self.layout();
|
||||||
match self.inner {
|
match self.inner {
|
||||||
CPlaceInner::Var(_local, var) => {
|
CPlaceInner::Var(_local, var) => {
|
||||||
let data = CValue(from.0, dst_layout).load_scalar(fx);
|
let data = match from.1.abi {
|
||||||
|
Abi::Scalar(_) => CValue(from.0, dst_layout).load_scalar(fx),
|
||||||
|
_ => {
|
||||||
|
let (ptr, meta) = from.force_stack(fx);
|
||||||
|
assert!(meta.is_none());
|
||||||
|
CValue(CValueInner::ByRef(ptr, None), dst_layout).load_scalar(fx)
|
||||||
|
}
|
||||||
|
};
|
||||||
let dst_ty = fx.clif_type(self.layout().ty).unwrap();
|
let dst_ty = fx.clif_type(self.layout().ty).unwrap();
|
||||||
transmute_scalar(fx, var, data, dst_ty);
|
transmute_scalar(fx, var, data, dst_ty);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue