Skip to content

Commit 7e3e73b

Browse files
committed
adjust code for copy_op changes
1 parent 3f63926 commit 7e3e73b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl Provenance for Tag {
169169
write!(f, "{:?}", sb)?;
170170
}
171171
Tag::Wildcard => {
172-
write!(f, "[Wildcard]")?;
172+
write!(f, "[wildcard]")?;
173173
}
174174
}
175175

src/shims/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
6868
"volatile_load" => {
6969
let [place] = check_arg_count(args)?;
7070
let place = this.deref_operand(place)?;
71-
this.copy_op(&place.into(), dest)?;
71+
this.copy_op(&place.into(), dest, /*allow_transmute*/ false)?;
7272
}
7373
"volatile_store" => {
7474
let [place, dest] = check_arg_count(args)?;
7575
let place = this.deref_operand(place)?;
76-
this.copy_op(dest, &place.into())?;
76+
this.copy_op(dest, &place.into(), /*allow_transmute*/ false)?;
7777
}
7878

7979
"write_bytes" | "volatile_set_memory" => {

tests/pass/transmute_fat.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
fn main() {
55
// If we are careful, we can exploit data layout...
6+
// This is a tricky case since we are transmuting a ScalarPair type to a non-ScalarPair type.
67
let raw = unsafe { std::mem::transmute::<&[u8], [*const u8; 2]>(&[42]) };
78
let ptr: *const u8 = unsafe { std::mem::transmute_copy(&raw) };
89
assert_eq!(unsafe { *ptr }, 42);

0 commit comments

Comments
 (0)