MCPcopy Create free account
hub / github.com/PLSysSec/wave / read_u32

Method read_u32

src/runtime.rs:261–269  ·  view source on GitHub ↗

#[ensures(effects!(old(trace), trace, effect!(ReadMem, addr, 4) if addr == start as usize))]

(&self, start: usize)

Source from the content-addressed store, hash-verified

259 #[ensures(trace_safe(trace, self))]
260 // #[ensures(effects!(old(trace), trace, effect!(ReadMem, addr, 4) if addr == start as usize))]
261 pub fn read_u32(&self, start: usize) -> u32 {
262 let bytes: [u8; 4] = [
263 self.mem[start],
264 self.mem[start + 1],
265 self.mem[start + 2],
266 self.mem[start + 3],
267 ];
268 u32::from_le_bytes(bytes)
269 }
270
271 /// read u64 from wasm linear memory
272 // Not thrilled about this implementation, but it works

Callers 3

read_u32_pairMethod · 0.80
wasi_sock_connectFunction · 0.80
readMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected