Write the correct size for PrimVall::IntegerPtr.
This commit is contained in:
parent
600ff26e65
commit
69c41f5372
1 changed files with 3 additions and 1 deletions
|
@ -201,6 +201,7 @@ impl Memory {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_primval(&mut self, ptr: Pointer, val: PrimVal) -> EvalResult<()> {
|
pub fn write_primval(&mut self, ptr: Pointer, val: PrimVal) -> EvalResult<()> {
|
||||||
|
let pointer_size = self.pointer_size;
|
||||||
match val {
|
match val {
|
||||||
PrimVal::Bool(b) => self.write_bool(ptr, b),
|
PrimVal::Bool(b) => self.write_bool(ptr, b),
|
||||||
PrimVal::I8(n) => self.write_int(ptr, n as i64, 1),
|
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::U8(n) => self.write_uint(ptr, n as u64, 1),
|
||||||
PrimVal::U16(n) => self.write_uint(ptr, n as u64, 2),
|
PrimVal::U16(n) => self.write_uint(ptr, n as u64, 2),
|
||||||
PrimVal::U32(n) => self.write_uint(ptr, n as u64, 4),
|
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!(),
|
PrimVal::AbstractPtr(_p) => unimplemented!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue