Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Make the flow summary filtering in the adapter. #16520

Merged

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented May 17, 2024

It turns out that the current logic for dataflow applied to summarized callables is inconsistent.
The following can happen:
If a callable in source is also considered a summarized callable because there exist a summary of a super implementation that apply to all overrides, then the source callable will not be included in DataFlowSummarizedCallable.
However, the callable will get summary nodes for the parameters and return, which will cause the uniqueEnclosingCallable test to fail (as there doesn't exist a corresponding DataFlowSummarizedCallable for the parameter and return summary nodes).
Instead of aligning the summary node and dataflow summarised callable implementation, it seems more consistent (and to ensure code cohesion) to move the exclusion logic to the adapter.

Another solution could be to add branch condition for summary nodes

TFlowSummaryNode(FlowSummaryImpl::Private::SummaryNode sn) {
  exists(DataFlowCallable dfc | dfc.asSummarizedCallable() = sn.getSummarizedCallable())
} or

Copy link
Contributor

github-actions bot commented May 17, 2024

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. A recent commit removed the previously reported differences.

@michaelnebel michaelnebel force-pushed the csharp/fixsummarizedcallabledataflow branch from 13ecb6c to 49696e7 Compare May 22, 2024 09:29
@github-actions github-actions bot removed the Java label May 22, 2024
@michaelnebel michaelnebel force-pushed the csharp/fixsummarizedcallabledataflow branch from 49696e7 to 18bcc5a Compare May 22, 2024 10:54
@michaelnebel michaelnebel force-pushed the csharp/fixsummarizedcallabledataflow branch from 18bcc5a to 2449074 Compare May 22, 2024 13:12
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label May 23, 2024
@michaelnebel
Copy link
Contributor Author

DCA looks good.

@michaelnebel michaelnebel marked this pull request as ready for review May 23, 2024 07:00
@michaelnebel michaelnebel requested a review from a team as a code owner May 23, 2024 07:00
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer!

@michaelnebel michaelnebel merged commit 95473c0 into github:main May 24, 2024
23 checks passed
@michaelnebel michaelnebel deleted the csharp/fixsummarizedcallabledataflow branch May 24, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants