wasm_interp: tests for store instructions

This commit is contained in:
Brian Carroll 2022-11-25 16:29:37 +00:00
parent 65fc079393
commit 06f3726e35
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
2 changed files with 197 additions and 21 deletions

View file

@ -19,9 +19,7 @@ pub enum Action {
#[derive(Debug)]
pub struct ExecutionState<'a> {
#[allow(dead_code)]
memory: Vec<'a, u8>,
pub memory: Vec<'a, u8>,
pub call_stack: CallStack<'a>,
pub value_stack: ValueStack<'a>,
pub globals: Vec<'a, Value>,
@ -168,6 +166,9 @@ impl<'a> ExecutionState<'a> {
let offset = self.fetch_immediate_u32(module);
let value = self.value_stack.pop();
let base_addr = self.value_stack.pop_u32();
dbg!(base_addr, offset);
let addr = (base_addr + offset) as usize;
(addr, value)
}