Repository navigation
fix(lifetime): reject local-reference escape through unbounded pointer parameters (#684 follow-up) - #1472
Merged
Conversation
…nded parameters (#684)
godofecht
marked this pull request as ready for review
October 10, 2026 16:01
godofecht
enabled auto-merge
October 10, 2026 16:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Soundness follow-up to #684
The composite-lifetime implementation is on
main. Its docs listed an unchecked case: storing a callback or frame local reference through an unannotated pointer/span parameter. The callee cannot establish how long caller-owned pointee storage lives.Rule
@lifetime(D)contract permits the store whenDis the same or shorter-lived than the writer.Regression coverage
domain_param_field_unbounded.flow: reject a callback-local array reference stored inout[0].view.domain_param_composite_unbounded.flow: reject a frame-local reference embedded in a wholeHolderassignment throughout[0].test_domain_fields.flow: accept an explicit@lifetime(callback)field throughptr<BoundHolder>.docs/language/domain-fields.mddescribes the rule.docs/project/Questions.mdrecords the decision.Verification
bootstrap_from_c.sh --verifypassed.typecheck_rules: 220 passed, 0 failed../flow test-lang tests/lang/test_domain_fields.flow: passed../flow tool doc_examples strict: 677 examples checked, including 36 expected errors.parity_typecheck.flowcompleted over 5,162 inputs.