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

repair ssa #1104

Open
wants to merge 90 commits into
base: develop
Choose a base branch
from
Open

repair ssa #1104

wants to merge 90 commits into from

Conversation

wangzun66
Copy link
Collaborator

@wangzun66 wangzun66 commented Oct 9, 2024

  • check and arrange classes for blocks order
  • repair and dominance finder
  • check and repair dominance tree
  • check ssa
  • fix ssa test_1
  • fix ssa test_2
  • fix with specified cases

closes #489

@wangzun66 wangzun66 self-assigned this Oct 10, 2024
Copy link
Contributor

Documentation Preview.

@wangzun66
Copy link
Collaborator Author

@Liyw979 SSA should work on your provided test cases. Thanks for your information. If you find any errors in SSA, please feel free to point them out. Thank you!

@Liyw979
Copy link
Contributor

Liyw979 commented Nov 6, 2024

@wangzun66 Thank you! I will do some tests tomorrow.

@Liyw979
Copy link
Contributor

Liyw979 commented Nov 7, 2024

I found some failing cases like

import java.io.*;
class Main {
    public static void main(String[] args) throws IOException {
        byte[] data;
        try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
            output.write(args[0].getBytes("UTF-8"));
            data = output.toByteArray();
        }
        System.out.println(new String(data, "UTF-8"));
    }
}
Caused by: java.lang.RuntimeException: The given block: Block [$stack11 := @caughtexception, l3 = $stack11] is not in BlockGraph!

@Liyw979
Copy link
Contributor

Liyw979 commented Nov 7, 2024

I would recommend collecting some oss package like log4j and run ssa through all methods to see if any method goes wrong.

@Liyw979
Copy link
Contributor

Liyw979 commented Nov 7, 2024

Also, I notice that some tests runs well with

      PathBasedAnalysisInputLocation.create(
        dir.toJava.toPath,
        SourceType.Application,
        java.util.List.of(StaticSingleAssignmentFormer())
      )

but failed with

      PathBasedAnalysisInputLocation.create(
        dir.toJava.toPath,
        SourceType.Application,
         (BytecodeBodyInterceptors.Default.getBodyInterceptors.asScala :+ StaticSingleAssignmentFormer()).asJava
      )

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.

BodyInterceptor: fix StaticSingleAssignmentFormer
3 participants