1
Fork 0

Fix drop fill checking on 32-bit hosts.

This commit is contained in:
Scott Olson 2016-04-15 03:16:35 -06:00
parent cea1ff4088
commit 84f21584ea
2 changed files with 7 additions and 2 deletions

View file

@ -393,8 +393,9 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> {
try!(self.memory.deallocate(contents_ptr));
}
Err(EvalError::ReadBytesAsPointer) => {
let possible_drop_fill = try!(self.memory.read_usize(ptr));
if possible_drop_fill == mem::POST_DROP_U64 {
let size = self.memory.pointer_size;
let possible_drop_fill = try!(self.memory.read_bytes(ptr, size));
if possible_drop_fill.iter().all(|&b| b == mem::POST_DROP_U8) {
return Ok(());
} else {
return Err(EvalError::ReadBytesAsPointer);