B5116: a cell outside the footprints might be read
Catalog status: active. Default severity: error. Stable name: frame-read. Family: Contracts and termination.
Inside a proof enclave, an operation reads only cells it is given: the cells in the footprints of its enclave objects (their Verada.Footprints components) on entry, and cells it allocated itself. A function over cells that it calls must likewise be given a footprint (an object, or a set of cells) within those. This is what lets the heap engine prove that the operation leaves every other object alone, and what makes a function's result depend only on its objects. A freed cell is never read.
Example (Vada)
procedure Bump_Second (S : in out Stack) is
begin
if S.Top /= null and then S.Top.Next /= null then
S.Top.Next.Value := 0; -- is S.Top.Next in S.Repr?
end if;
end Bump_Second;What to do (Vada)
State in the type's invariant what the footprint holds (every node of the structure, and, for closure, that every pointer its cells hold is null or in it), so that each cell reached is known to be in it; give a helper function over cells the footprint it walks.
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See contracts and termination, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.