Ptr - #1469
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42ce9fb159
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce37ed5675
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
On hold till after 26.2 release. |
micahscopes
left a comment
There was a problem hiding this comment.
agent:
One borrowck question without a single line to hang it on: callee analysis
seeds pointer params as pairwise-disjoint pointees, but I couldn't find
anywhere that rejectsf(p, p)— no check at the call site, no diagnostic in
the callee. Is the no-alias contract meant to be checked, modeled as may-alias,
or documented as a soundness precondition?
|
agent:
|
|
agent:
|
|
agent:
|
bda49ea to
311fc25
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 311fc250a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This PR adds first-class typed memory pointers to Fe and redesigns the core, ABI, and EVM memory APIs around explicit pointer, view, ownership, and capacity types.
The previous APIs represented memory addresses primarily as
u256values or effect-handle wrappers. This made it difficult for the type system and borrow analysis to distinguish memory pointers from integer-backed handles, track pointer provenance, prevent pointers from escaping into storage, and express bounded memory operations.Language changes
*T.*ptr.IndexandIndexMutfor pointer-backed arrays and memory arrays.items[i] += valuethroughIndexMut.*at the start of a line as a dereference. Multiline multiplication must keep*on the preceding line.* *ptrlexically separate when formatting because**is the exponentiation token.Memory APIs
Adds
core::ptrwith:*T: a typed address in linear memory.MemArray<T>: a dynamically sized typed memory allocation.MemSlice<T>: a copyable, read-only bounded view.MemSpan: an alias forMemSlice<u8>.MemBuffer: an owned byte allocation with separate logical length and writable capacity.FixedMemBuffer<N>: a fixed-size, non-escaping allocation that exposes constant allocation sizes to backend scratch-memory planning.Memory-bearing EVM APIs now accept
MemSpan,MemBuffer, or typed pointers instead of loose integer address/length pairs. This applies to hashing, logging, copying, return/revert data, contract creation, ABI encoding, and low-level calls.Low-level call results retain both the amount written into the supplied output buffer and the complete returndata length. Higher-level call outcomes can preserve owned returndata for decoding or bubbling reverts.
ABI changes
Encode<A>now writes directly to*u8.MemBuffer.AbiEncoderabstraction.Pointer safety
The compiler now tracks pointer provenance through aggregates, projections, calls, control flow, and returns.
Pointer-bearing values cannot be written into persistent or transient storage, including through generic functions that become storage-specialized later.
Memory pointers implement
EffectHandledirectly. User-defined effect handles must use*Targetand the memory address space; integer-backed handles remain reserved for compiler-provided core and standard-library address spaces.Parser and tooling
*policy.||conditions.Breaking changes and migration
MemPtr<T>*Tcore::abi::MemoryInputMemSpanor anotherByteInputstd::evm::MemoryBytesMemSpanstd::evm::mem::alloccore::ptrallocation helpers orMemBufferMemSpan,MemBuffer, or*TAbiEncoderEncode::encode(..., *u8)and allocation helpers returningMemBufferInto<T>