Skip to content

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Aug 28, 2025

Fixes the issue discussed here. DCA is uneventful.

@github-actions github-actions bot added the C# label Aug 28, 2025
@hvitved hvitved force-pushed the csharp/dataflow-base-non-exact-type branch from 8c4e938 to aa3f4e1 Compare August 28, 2025 11:26
@hvitved hvitved marked this pull request as ready for review August 29, 2025 08:37
@hvitved hvitved requested a review from a team as a code owner August 29, 2025 08:37
@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 08:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes context-sensitive dispatch when using the base qualifier in C#. The issue was that the type inference for base expressions was using the base class type instead of the derived class type, which affected data flow analysis accuracy.

  • Adds a helper predicate getBaseAdjustedType to determine the correct type for base access expressions
  • Updates the contextArgHasType predicate to use the adjusted type for base expressions
  • Simplifies formatting in the getType method

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Dispatch.qll Core fix implementing proper type inference for base expressions in dispatch logic
CallSensitivityFlow.cs Test case demonstrating the fixed behavior with base qualifier calls
CallSensitivityFlow.expected Expected test results reflecting improved data flow tracking
2025-08-29-base-qualifier-dispatch.md Change note documenting the bug fix

@hvitved hvitved requested a review from michaelnebel September 1, 2025 06:38
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM!

@hvitved hvitved merged commit aa60442 into github:main Sep 1, 2025
24 checks passed
@hvitved hvitved deleted the csharp/dataflow-base-non-exact-type branch September 1, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants