wasm_interp: implement calls with arguments

This commit is contained in:
Brian Carroll 2022-11-23 22:01:36 +00:00
parent 3aeab0dbd7
commit 6523b38847
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
5 changed files with 160 additions and 74 deletions

View file

@ -256,6 +256,12 @@ impl<'a> TypeSection<'a> {
pub fn is_empty(&self) -> bool {
self.bytes.is_empty()
}
pub fn look_up_arg_count(&self, sig_index: u32) -> u32 {
let mut offset = self.offsets[sig_index as usize];
offset += 1; // separator
u32::parse((), &self.bytes, &mut offset).unwrap()
}
}
impl<'a> Section<'a> for TypeSection<'a> {