Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Sep 4, 2023

Identified via #14108.

@github-actions github-actions bot added the C# label Sep 4, 2023
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Sep 5, 2023
@hvitved hvitved marked this pull request as ready for review September 5, 2023 06:31
@hvitved hvitved requested a review from a team as a code owner September 5, 2023 06:31
@michaelnebel
Copy link
Contributor

@hvitved : Could elaborate, preferably with an example, what this change fixes?

@hvitved
Copy link
Contributor Author

hvitved commented Sep 6, 2023

Could elaborate, preferably with an example, what this change fixes?

When we see a property write such as foo.Bar = baz, we need to get a hold of the relevant associated control flow nodes (one for foo, one for baz, and one for the call to set_Bar). We do this using the ControlFlowReachability library, searching either forwards or backwards in the CFG from (e.g.) a control flow node for foo to the control flow node for the call to set_Bar. The search should, however, be limited to the syntactic scope that is the property assignment (otherwise, if the assignment happens in a loop, we would be able to mix up nodes). And it is the syntactic scope that was wrong; previously it was simply the LHS foo.Bar, while now it is the entire assignment.

@hvitved hvitved merged commit 3a9c34c into github:main Sep 6, 2023
@hvitved hvitved deleted the csharp/data-flow-property-write branch September 6, 2023 06:49
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.

3 participants