Skip to content

Commit a589ccb

Browse files
authored
Merge pull request rust-lang#225 from RalfJung/comments
cast -> transmute
2 parents 42d3eda + 51b4321 commit a589ccb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/eval_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
13471347
I128 => 16,
13481348
Is => self.memory.pointer_size(),
13491349
};
1350-
// if we cast a ptr to an isize, reading it back into a primval shouldn't panic
1350+
// if we transmute a ptr to an isize, reading it back into a primval shouldn't panic
13511351
// Due to read_ptr ignoring the sign, we need to jump around some hoops
13521352
match self.memory.read_int(ptr, size) {
13531353
Err(EvalError::ReadPointerAsBytes) if size == self.memory.pointer_size() => self.memory.read_ptr(ptr)?,
@@ -1366,7 +1366,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
13661366
Us => self.memory.pointer_size(),
13671367
};
13681368
if size == self.memory.pointer_size() {
1369-
// if we cast a ptr to an usize, reading it back into a primval shouldn't panic
1369+
// if we transmute a ptr to an usize, reading it back into a primval shouldn't panic
13701370
self.memory.read_ptr(ptr)?
13711371
} else {
13721372
PrimVal::from_u128(self.memory.read_uint(ptr, size)?)

0 commit comments

Comments
 (0)