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

Method translate_iovs

src/runtime.rs:386–410  ·  view source on GitHub ↗
(&self, iovs: &WasmIoVecs)

Source from the content-addressed store, hash-verified

384 }
385 )]
386 pub fn translate_iovs(&self, iovs: &WasmIoVecs) -> NativeIoVecs {
387 let mut idx = 0;
388 let mut native_iovs = NativeIoVecs::new();
389 let iovcnt = iovs.len();
390 while idx < iovcnt {
391 body_invariant!(idx < iovcnt);
392 body_invariant!(native_iovs.len() == idx);
393 body_invariant!(ctx_safe(self));
394 body_invariant!(trace_safe(trace, self));
395 body_invariant!(
396 forall(|idx: usize| (idx >= 0 && idx < native_iovs.len()) ==> {
397 let wasm_iov = iovs.lookup(idx);
398 let iov = native_iovs.lookup(idx);
399 iov.iov_base == raw_ptr(self.mem.as_slice()) + (wasm_iov.iov_base as usize) &&
400 iov.iov_len == (wasm_iov.iov_len as usize)
401 }));
402
403 let iov = iovs.lookup(idx);
404 let native_iov = self.translate_iov(iov);
405 native_iovs.push(native_iov);
406 idx += 1;
407 }
408
409 native_iovs
410 }
411}

Callers 4

trace_readvFunction · 0.80
trace_preadvFunction · 0.80
trace_writevFunction · 0.80
trace_pwritevFunction · 0.80

Calls 4

translate_iovMethod · 0.80
lenMethod · 0.45
lookupMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected