Repository navigation
Conversation
…estroys it
cJSON_Delete and most linked-structure destroyers copy the parameter
into a local and free the local as they walk (`cur = t; while (cur) {
next = cur->next; free(cur); cur = next; }`). fd_local_alias_param took
any non-parameter source of the local as the end of the alias, so the
parameter was never destroyed, the record had no unary destroyer, and
every producer of it stayed raw (cjson: 79 functions, 0 presented, in
the #3116 rerun). A source that is a part of the local itself, or a
local made only of such parts, recorded after the first destroying sink
keeps the alias: the first iteration frees the parameter. One recorded
before the sink (`cur = cur->next; free(cur)`) still breaks it. The
ownership walk records a for statement's increment after its body, so
`for (cur = t; cur; cur = next)` reads in execution order.
Fixture: conan_facade_walking_destroyer_test (a while walk, a for walk,
and an advance-then-free that must not count).
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.
Stack created with GitHub Stacks CLI • Give Feedback 💬