Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sahilagichani14
Copy link
Collaborator

Todo: fix for try-catch blocks

@sahilagichani14 sahilagichani14 self-assigned this Aug 26, 2024
@sahilagichani14 sahilagichani14 linked an issue Aug 26, 2024 that may be closed by this pull request
Copy link
Collaborator

@swissiety swissiety left a comment

Choose a reason for hiding this comment

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

this seems expensive - old Soot did cut the connection to the never reached branch and was calling UnreachableCodeEliminator afterwards, which at least looks simpler/cleaner than the current state (havent checked if the proposed algorithm is faster e.g. due to a possible smaller n?)

@sahilagichani14
Copy link
Collaborator Author

this seems expensive - old Soot did cut the connection to the never reached branch and was calling UnreachableCodeEliminator afterwards, which at least looks simpler/cleaner than the current state (havent checked if the proposed algorithm is faster e.g. due to a possible smaller n?)

Old soot has a connection to statements and not blocks, so removing a statement is simpler than removing intermediate blocks.

@swissiety
Copy link
Collaborator

this seems expensive - old Soot did cut the connection to the never reached branch and was calling UnreachableCodeEliminator afterwards, which at least looks simpler/cleaner than the current state (havent checked if the proposed algorithm is faster e.g. due to a possible smaller n?)

Old soot has a connection to statements and not blocks, so removing a statement is simpler than removing intermediate blocks.

can you explain why? I would assume it is instantly "infecting" the complete block (so all its following FallsthroughStmts) if that (head)stmt needs to be removed and not just unlinked from the IfStmt. So it would skip the checks on the "infected" block and only has to go on with the checks on the next block instead of each Stmt of the infected Block. -- Lets have a call.

@swissiety
Copy link
Collaborator

fixing the iterator should have fixed:

@sahilagichani14 sahilagichani14 marked this pull request as draft September 5, 2024 12:49
@sahilagichani14
Copy link
Collaborator Author

#996

@sahilagichani14 sahilagichani14 changed the title fix and implement ConditionalBranchFolder fix and implement ConditionalBranchFolder, Unreachable Code Eliminator Sep 15, 2024
swissiety and others added 10 commits September 16, 2024 08:06
…r-removes-complete-tail-of-the-cfg

# Conflicts:
#	sootup.java.bytecode.frontend/src/test/java/sootup/java/bytecode/frontend/TryCatchFinallyTests.java
#	sootup.java.bytecode.frontend/src/test/java/sootup/java/bytecode/frontend/interceptors/ConditionalBranchFolderTest.java
@swissiety
Copy link
Collaborator

ping.

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.

[Bug]: ConditionalBranchfolder removes complete tail of the CFG

3 participants