Fix three-way-merge to be field-sensitive with --vsd-structs every-field#8805
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Fix three-way-merge to be field-sensitive with --vsd-structs every-field#8805tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8805 +/- ##
========================================
Coverage 80.01% 80.01%
========================================
Files 1700 1700
Lines 188345 188381 +36
Branches 73 73
========================================
+ Hits 150696 150731 +35
- Misses 37649 37650 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
459076c to
a4f1655
Compare
a4f1655 to
cb267f9
Compare
There was a problem hiding this comment.
Pull request overview
Improves three-way merge behavior under --vsd-structs every-field by making merges field-sensitive for structs and recursively descending into nested struct fields, while conservatively treating arrays as wholly modified.
Changes:
- Added recursive path collection to identify leaf-level modified fields within structs (and conservative handling for arrays).
- Updated three-way merge of function returns to assign only modified sub-paths rather than entire symbols.
- Added a regression test covering field-sensitive merges for struct fields.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/analyses/variable-sensitivity/variable_sensitivity_domain.cpp | Adds recursive modified-path discovery and uses it to selectively assign modified fields during three-way merge. |
| regression/goto-analyzer/variable-sensitivity-assign-aware-merge-struct-02/test.desc | Adds a regression driver for --three-way-merge with --vsd-structs every-field. |
| regression/goto-analyzer/variable-sensitivity-assign-aware-merge-struct-02/main.c | Adds a C test exercising field-level preservation across merges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
For structs with struct-typed fields, merging now recursively descends to identify leaf-level modifications. Array handling uses a conservative approach (marking entire array as modified) since enumerating all indices is not practical. Co-authored-by: Kiro autonomous agent Fixes: diffblue#6272 Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
cb267f9 to
f8bd2b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For structs with struct-typed fields, merging now recursively descends to identify leaf-level modifications. Array handling uses a conservative approach (marking entire array as modified) since enumerating all indices is not practical.
Co-authored-by: Kiro autonomous agent
Fixes: #6272