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

Function wasm2c_marshal_and_writeback_prestat

src/writeback.rs:43–60  ·  view source on GitHub ↗
(
    ctx: &mut VmCtx,
    addr: usize,
    res: RuntimeResult<u32>,
)

Source from the content-addressed store, hash-verified

41#[ensures(ctx_safe(ctx))]
42#[ensures(trace_safe(trace, ctx))]
43pub fn wasm2c_marshal_and_writeback_prestat(
44 ctx: &mut VmCtx,
45 addr: usize,
46 res: RuntimeResult<u32>,
47) -> u32 {
48 if !ctx.fits_in_lin_mem_usize(addr, 12) {
49 return RuntimeError::Eoverflow.into();
50 }
51 //log::debug!("wasm2c_marshal_and_writeback_prestat: {:?}", result);
52 match res {
53 Ok(r) => {
54 ctx.write_u32(addr, 0);
55 ctx.write_u64(addr + 4, r as u64); // writeback result
56 0
57 }
58 Err(err) => err.into(),
59 }
60}
61
62#[with_ghost_var(trace: &mut Trace)]
63#[requires(ctx_safe(ctx))]

Calls 3

fits_in_lin_mem_usizeMethod · 0.80
write_u32Method · 0.80
write_u64Method · 0.80

Tested by

no test coverage detected