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

Fix some issues in MutableBlockStmtGraph #708

Merged

Conversation

Timbals
Copy link
Contributor

@Timbals Timbals commented Oct 10, 2023

removeNode had multiple issues with keepFlow = true (which is the default).
It would remove too many edges and also treated the flow inside a block and the flow between blocks differently.
This also caused the issue with the DeadAssignmentEliminator that resulted in an invalid statement graph.

Added a test for the issue with the DeadAssignmentEliminator producing an invalid statement graph.

removeNode with keepFlow = true will now remove the statement and connect all predecessors of the statement with the successor of the statement to maintain the flow. The method will also throw an IllegalArgumentException when the statement to be removed has multiple successors (a branching statement), because the semantics of "keeping the flow" are not unambiguous here.

removeEdge didn't split blocks correctly and removed too many edges between blocks. This was also fixed. Also removed removeBlockBorderEdgesInternal. This implemented somewhat complicated logic that was easier to move inside of removeEdge.

@Timbals Timbals force-pushed the fix/MutableBlockStmtGraph branch from 4006651 to 0b95967 Compare October 10, 2023 12:18
@Timbals Timbals force-pushed the fix/MutableBlockStmtGraph branch from 8134baf to 94bfeb3 Compare October 10, 2023 13:40
@Timbals Timbals changed the base branch from fix/LocalSplitter_DeadAssignmentEliminator_664_struce to add/intraprocedural October 10, 2023 13:40
@Timbals Timbals changed the title Fix mutable block stmt graph Fix some issues in MutableBlockStmtGraph Oct 17, 2023
@Timbals Timbals marked this pull request as ready for review October 17, 2023 12:33
@swissiety swissiety merged commit f1d453a into soot-oss:add/intraprocedural Oct 18, 2023
@Timbals Timbals deleted the fix/MutableBlockStmtGraph branch January 19, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants