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

Function wasm2c_marshal_and_writeback_u64

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

Source from the content-addressed store, hash-verified

65#[ensures(ctx_safe(ctx))]
66#[ensures(trace_safe(trace, ctx))]
67pub fn wasm2c_marshal_and_writeback_u64(
68 ctx: &mut VmCtx,
69 addr: usize,
70 res: RuntimeResult<u64>,
71) -> u32 {
72 if !ctx.fits_in_lin_mem_usize(addr, 8) {
73 return RuntimeError::Eoverflow.into();
74 }
75 //log::debug!("wasm2c_marshal_and_writeback_u64: {:?}", result);
76 match res {
77 Ok(r) => {
78 ctx.write_u64(addr, r); // writeback result
79 0
80 }
81 Err(err) => err.into(),
82 }
83}
84
85#[with_ghost_var(trace: &mut Trace)]
86#[requires(ctx_safe(ctx))]

Calls 2

fits_in_lin_mem_usizeMethod · 0.80
write_u64Method · 0.80

Tested by

no test coverage detected