The Wayback Machine - https://web.archive.org/web/20260205055524/https://github.com/github/codeql/pull/8898
Skip to content

Data flow: Introduce 'with/without content' summary components#8898

Merged
hvitved merged 3 commits intogithub:mainfrom
hvitved:dataflow/clear-expect-summary-components
May 11, 2022
Merged

Data flow: Introduce 'with/without content' summary components#8898
hvitved merged 3 commits intogithub:mainfrom
hvitved:dataflow/clear-expect-summary-components

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Apr 27, 2022

This PR introduces

SummaryComponent withoutContent(ContentSet c);
SummaryComponent withContent(ContentSet c);

to FlowSummaryImpl.qll for C#, Java, and Ruby.

The new SummaryComponents are only meant to be used in input specifications, and they gives rise to new synthesized nodes n at which clearsContent(n, c) resp. expectsContent(n, c) holds. This means that we can interpret SummarizedCallable::clearsContent(ParameterPosition ppos, ContentSet cs) as a summary with input stack

SummaryComponentStack::push(SummaryComponent::withoutContent(cs), SummaryComponentStack::argument(ppos))

and output stack

SummaryComponentStack::argument(ppos)

Ultimately, we should get rid of SummarizedCallable::clearsContent(ParameterPosition ppos, ContentSet cs) and use summaries like the above instead, but that will be done follow-up.

@hvitved hvitved force-pushed the dataflow/clear-expect-summary-components branch 3 times, most recently from 7566f09 to da82ed8 Compare April 28, 2022 08:19
@hvitved hvitved changed the title Data flow: Introduce clear/expect summary components Data flow: Introduce 'with/without content' summary components Apr 28, 2022
@hvitved hvitved force-pushed the dataflow/clear-expect-summary-components branch 3 times, most recently from 02a9ee1 to 46f4eb9 Compare May 5, 2022 07:55
@hvitved hvitved marked this pull request as ready for review May 5, 2022 08:32
@hvitved hvitved requested review from a team as code owners May 5, 2022 08:32
@hvitved hvitved added the no-change-note-required This PR does not need a change note label May 5, 2022
@hvitved hvitved force-pushed the dataflow/clear-expect-summary-components branch from 46f4eb9 to 04cc738 Compare May 5, 2022 12:26
@hvitved hvitved merged commit 333780e into github:main May 11, 2022
@hvitved hvitved deleted the dataflow/clear-expect-summary-components branch May 11, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants