Int Branching instructions

This commit is contained in:
vegowotenks 2024-09-10 01:33:35 +02:00
parent ede316cec3
commit 6610b09c16
4 changed files with 283 additions and 82 deletions

View file

@ -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 {