1
Fork 0

Write the correct size for PrimVall::IntegerPtr.

This commit is contained in:
Scott Olson 2016-03-21 05:42:42 -06:00
parent 600ff26e65
commit 69c41f5372

View file

@ -201,6 +201,7 @@ impl Memory {
}
pub fn write_primval(&mut self, ptr: Pointer, val: PrimVal) -> EvalResult<()> {
let pointer_size = self.pointer_size;
match val {
PrimVal::Bool(b) => self.write_bool(ptr, b),
PrimVal::I8(n) => self.write_int(ptr, n as i64, 1),
@ -210,7 +211,8 @@ impl Memory {
PrimVal::U8(n) => self.write_uint(ptr, n as u64, 1),
PrimVal::U16(n) => self.write_uint(ptr, n as u64, 2),
PrimVal::U32(n) => self.write_uint(ptr, n as u64, 4),
PrimVal::U64(n) | PrimVal::IntegerPtr(n) => self.write_uint(ptr, n as u64, 8),
PrimVal::U64(n) => self.write_uint(ptr, n as u64, 8),
PrimVal::IntegerPtr(n) => self.write_uint(ptr, n as u64, pointer_size),
PrimVal::AbstractPtr(_p) => unimplemented!(),
}
}