Skip to content

i3195 - #3197

Merged
ehartford merged 1 commit into
mainfrom
i3195
Nov 9, 2026
Merged

i3195#3197
ehartford merged 1 commit into
mainfrom
i3195

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Stack created with GitHub Stacks CLI • Give Feedback 💬

@ehartford
ehartford added this pull request to stack #3199 November 9, 2026 08:13
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant