Repository navigation
#3123: slot producers and destroyers are proven; a prototype c_import does not import is no contract item - #3263
Merged
Merged
Conversation
added 2 commits
November 11, 2026 12:55
…oyer that frees through a pointer to its pointer are proven libcurl's curl_easy_init is `Curl_open(&data); return data;` and curl_easy_cleanup is `Curl_close(&data)`. Both read as 'local data is stored or its address taken'. Three evidence records say what happens at a slot: `localaddr` (the address of a local passed to a named callee), `outstore` with `localout` (a store through the slot a parameter points at), and `localslot` (a local loaded from it). - A callee whose every store through the slot is NULL or an allocation nothing else keeps hands its caller a fresh allocation (fd_out_fresh). - A callee that loads the slot into a local and frees it destroys what the caller's local stands for (fd_slot_destroys). - Anything else is the store it was: a callee that also keeps the pointer, one that also returns it, a closer that frees nothing, a slot filled from a parameter. The address of a local standing for a parameter, passed to a callee not proven to free, is judged after destruction is known and counts as retention. Test: test/internals/conan_facade_slot_producer_destroyer_test.w (one proven shape, four refused).
The battery's libxml2 scenario failed: the new slot proofs prove
`__xmlParserInputBufferCreateFilename` a producer, the drafter wrote
`from __xmlParserInputBufferCreateFilename`, and the facade was refused
('not a declaration in scope'): c_import imports no function whose name
starts with `_`. Any prototype counted as API; one c_import does not read
is now the library's own, like a definition with no prototype.
Test: conan_facade_slot_producer_destroyer_test.w gains a proven producer
named `__good_init_internal`; without the fix the facade lists it.
ehartford
marked this pull request as ready for review
November 11, 2026 21:15
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.
open(&data); return data;) and a destroyer that frees through a pointer to its pointer (close(&data)) are proven from the callee's body. One proven shape and four refused ones in test/internals/conan_facade_slot_producer_destroyer_test.w.unsafemakes and drops an easy handle.__xmlParserInputBufferCreateFilenamewas written into the generated file, and c_import imports no function whose name starts with_. Such a prototype is now internal. The fixture is untouched.Battery: GREEN on this commit 282e783 (seed-driven,
with uat --strict).