This commit is contained in:
Brian Carroll 2022-11-24 12:06:12 +00:00
parent 6523b38847
commit f10262a41d
No known key found for this signature in database
GPG Key ID: 5C7B2EC4101703C0
3 changed files with 8 additions and 4 deletions

View File

@ -106,9 +106,9 @@ impl<'a> ExecutionState<'a> {
if let Some((return_addr, block_depth)) = self.call_stack.pop_frame() {
self.program_counter = return_addr as usize;
self.block_depth = block_depth;
return Action::Continue;
Action::Continue
} else {
return Action::Break;
Action::Break
}
}

View File

@ -36,6 +36,10 @@ impl<'a> ValueStack<'a> {
self.is_64.len()
}
pub fn is_empty(&self) -> bool {
self.is_64.is_empty()
}
pub fn push(&mut self, value: Value) {
match value {
Value::I32(x) => {

View File

@ -6,11 +6,11 @@ use roc_wasm_module::{
opcodes::OpCode, SerialBuffer, Serialize, Signature, Value, ValueType, WasmModule,
};
fn default_state<'a>(arena: &'a Bump) -> ExecutionState {
fn default_state(arena: &Bump) -> ExecutionState {
let pages = 1;
let program_counter = 0;
let globals = [];
ExecutionState::new(&arena, pages, program_counter, globals)
ExecutionState::new(arena, pages, program_counter, globals)
}
// #[test]