B5119: two objects' footprints might share a cell
Catalog status: active. Default severity: error. Stable name: footprints-overlap. Family: Contracts and termination.
The footprints of distinct enclave objects are disjoint: no cell belongs to two objects, so changing one cannot change the other. Every operation that changes two objects proves that their footprints are still disjoint when it returns, and each operation assumes it of the objects it is given.
Example (Vada)
procedure Share (A, B : in out Stack) is
begin
B.Top := A.Top;
B.Repr := A.Repr; -- A's cells are now B's too
end Share;What to do (Vada)
Give each object its own cells: copy the elements into new cells for the second object, or move the cells, taking them out of the first object's footprint.
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.