Int Branching instructions
This commit is contained in:
parent
ede316cec3
commit
6610b09c16
4 changed files with 283 additions and 82 deletions
|
@ -304,6 +304,14 @@ impl StackFrame {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn load_local_float(&self, index: u16) -> Result<f32, Error> {
|
||||
let local = self.locals[index as usize];
|
||||
match local {
|
||||
StackValue::Float(f) => Ok(f),
|
||||
_ => Err(Error::LocalError(format!("Mismatched type at index {} of the function locals, expected Float but found '{:?}'", index, local)))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_local_int(&self, index: u16) -> Result<i32, Error> {
|
||||
let local = self.locals[index as usize];
|
||||
match local {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue