DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B2019: an access type or access result in an enclave's visible part

Catalog status: active. Default severity: error. Stable name: enclave-pointer-visible. Family: Types and constraints.

A proof enclave's pointers are declared in its private part or body, where only its own code follows them. An access type in the visible part would let clients hold, copy and follow pointers into cells the enclave shares, and a public function that returns an access value from an enclave object would hand out a path into its cells: an enclave gives its elements by value.

Example (Vada)

package Lists
  with Annotate => (Verada, Enclave)
is
   type List is limited private;
   type Cell is record
      Value : Integer;
   end record;
   type Cell_Ptr is access Cell;   --  visible to clients
   ...

What to do (Vada)

Move the access type to the private part, and give clients operations that take or return the elements by value (Element, Replace_Element).

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See types and constraints, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.