aboutsummaryrefslogtreecommitdiffstats
path: root/bytecode/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bytecode/src/data.rs')
-rw-r--r--bytecode/src/data.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/bytecode/src/data.rs b/bytecode/src/data.rs
index e14eaa9..4774f2a 100644
--- a/bytecode/src/data.rs
+++ b/bytecode/src/data.rs
@@ -52,7 +52,10 @@ impl Value {
pub fn to_pointer(self) -> Result<Pointer, String> {
let Value(stack_representation) = self;
if !self.is_pointer() {
- return Err(format!("value {:x} is not a pointer", stack_representation));
+ return Err(format!(
+ "value 0x{:x} is not a pointer",
+ stack_representation
+ ));
}
return Ok(Pointer(usize::try_from(stack_representation).unwrap()));
}
@@ -69,7 +72,7 @@ impl Value {
pub fn to_int(self) -> Result<i64, String> {
let Value(stack_representation) = self;
if !self.is_int() {
- return Err(format!("value {:x} is not an int", stack_representation));
+ return Err(format!("value 0x{:x} is not an int", stack_representation));
}
return Ok(stack_representation as i64 >> 1);
}