Repository navigation
Merged
Conversation
…he field is written in exactly one place, by a named package function, and its record never leaves what the drafter reads Eric's ruling on #3206 shape A (D198): the closed-world 'every store in the corpus' proof is refused; the callee of a call through a function-pointer field is proven only under conditions the drafter can enumerate. CImport.w collects, from every definition and every variable initializer, each write of a function-pointer field (an assignment, a positional or designated initializer entry), each pointer to a record passed to a callee, each conversion of such a pointer, and each field address taken (ci_fnptr_field_evidence; lines carry their location, so a header's table counts once). CiFacadeDraft.w draws one verdict per Record.field: proven when there is exactly one write, it names a function whose body the proofs read, the record is passed only to such functions (or free), no pointer to it is converted, and every unit was read. A proven field is its one function: retention, destruction and the return are that function's. An unproven one says which condition failed, which is what a registry fact must state: 'written in 2 places (show_a, show_b)', 'a pointer to the record is passed to memset, which the proofs cannot read', 'the package never writes it (its value is the caller's)'. Sinks name the field with its record (`*Record.field`). tools/facade_coverage.w clusters the reasons by condition. Fixtures: conan_facade_fnptr_field_proof_test (each condition); conan_facade_dispatch_sink_test and conan_facade_jump_table_callee_test now see their single static table proven (the first finds the real retention behind it, the second presents its producer and destroyer).
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.
Implements Eric's ruling on #3206 shape A (D198, #3211). The callee of a call through a function-pointer field is proven only when the field is written in exactly one place, by a named package function, and its record never leaves what the drafter reads (no pointer to it passed to a function without a body here, none converted to another pointer type, every unit read). CImport.w collects every field write and record escape; CiFacadeDraft.w draws one verdict per
Record.field. A proven field is its one function; an unproven one says which condition failed, which is what a registry fact must state. tools/facade_coverage.w clusters by condition.On real code (glfw, pcre2, libpng) no field is proven, as the ruling expected for all but static single tables: the reports now read 'written in 2 places', 'a pointer to the record is passed to memset, which the proofs cannot read', and so on.
Fixtures: conan_facade_fnptr_field_proof_test (each condition), and the two existing dispatch fixtures, whose single static table is now proven. Shape B (the facts clause) is not in this PR: its spec words are drafted on #3206 and unblessed.
Battery GREEN on 7d1729e (
with run tools/battery.win ~/.local/with-staging/i3206, wall 437 s after a green gate and internals lane; GREEN BATTERY_DONE).