Add a new property that encoding and decoding a memory capability gives the same result. This caught the most recent bug.

This commit is contained in:
Jonathan Woodruff
2025-01-31 11:05:08 +00:00
parent eb6f9ebade
commit 033135b5f6
3 changed files with 26 additions and 0 deletions

View File

@@ -178,4 +178,11 @@ function Bool prop_isInBounds(CapAddr base, CapAddr len, CapAddr addr);
return forallCap(base, len, addr, prop);
endfunction
(* noinline *)
function Bool prop_fromToMem(CapMem in);
CapPipe cp = fromMem(unpack(in));
CapMem cm = pack(toMem(cp));
return (cm == in);
endfunction
endpackage