MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / exec_memory_fill_impl

Method exec_memory_fill_impl

crates/tinywasm/src/interpreter/executor.rs:1309–1320  ·  view source on GitHub ↗
(&mut self, addr: u32, dst: i32, val: u8, size: i32)

Source from the content-addressed store, hash-verified

1307 }
1308
1309 fn exec_memory_fill_impl(&mut self, addr: u32, dst: i32, val: u8, size: i32) -> Result<(), Trap> {
1310 let mem = self.store.state.get_mem_mut(self.module.resolve_mem_addr(addr));
1311 if mem.inner.fill(dst as usize, size as usize, val).is_none() {
1312 cold_path();
1313 return Err(Trap::MemoryOutOfBounds {
1314 offset: dst as usize,
1315 len: size as usize,
1316 max: self.store.state.get_mem(self.module.resolve_mem_addr(addr)).inner.len(),
1317 });
1318 }
1319 Ok(())
1320 }
1321
1322 fn exec_memory_init(&mut self, data_index: u32, mem_index: u32) -> Result<(), Trap> {
1323 let size = i32::stack_pop(&mut self.store.value_stack);

Callers 2

exec_memory_fillMethod · 0.80
exec_memory_fill_immMethod · 0.80

Calls 5

get_mem_mutMethod · 0.80
resolve_mem_addrMethod · 0.80
get_memMethod · 0.80
fillMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected