DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B5118: a footprint might take a cell that was neither its objects' nor new

Catalog status: active. Default severity: error. Stable name: footprint-grows. Family: Contracts and termination.

When an enclave operation returns, the footprints of the objects it changed are made of cells that were already theirs and cells it allocated, and hold no cell it freed: an operation cannot take a cell from an object it was not given, which would then share it, and a footprint never holds a cell that no longer exists.

Example (Vada)

   procedure Take (S : in out Stack; Other : Stack) is
   begin
      S.Repr := Node_Cells.Union (S.Repr, Other.Repr);   --  Other's cells, now shared
   end Take;

What to do (Vada)

Build a footprint from the object's own cells and new ones; to move cells from one object to another, have the operation change both (both in out), and remove them from the first.

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.