From 69c41f53726f9b91d2806bb5d9f31c37a83aaa6c Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Mon, 21 Mar 2016 05:42:42 -0600 Subject: [PATCH] Write the correct size for PrimVall::IntegerPtr. --- src/memory.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/memory.rs b/src/memory.rs index cff4cc35c84..72dd0d9b1e9 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -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!(), } }