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: IfRegionMaker find the wrong outBlock #2385

Merged
merged 2 commits into from
Dec 30, 2024

Conversation

ewt45
Copy link
Contributor

@ewt45 ewt45 commented Dec 30, 2024

this pr tries to solve the issue #2384

when checking whether the then/else block should be extracted as out block,

  • firstly use getPathCross to get the cross point(outBlock) of the two blocks. if it's not null, the codes will simply compare out block with then/else block.
  • otherwise the code will fall back to the old method allPathsFromIf.

Inside the method getPathCross:

  • start block itself is also considered as possible cross point now.
  • when building excluded bitset, add handlerBlock.getId() instead of handlerBlock.getDomFrontier(). this is to fix a test class failure after the changing above. I'm not sure if this will break other cases.
  • remove combinedDF.clear(block.getId()); in the while loop. it seems that this line is trying to remove the current block after next domFront blocks are added, but current block is stored at domFrontBS rather than combinedDF.

after these changes, now decompiled result is much better

  • out block is correct
  • however catch block lacks of a line viewFacade = null;
    /* JADX WARN: Multi-variable type inference failed */
    protected void onCreate(Bundle bundle) {
        ViewFacade viewFacade;
        super.onCreate(bundle);
        ApplicationStateBase applicationState = getApplicationState();
        XServerComponent component = applicationState.getEnvironment().getComponent(XServerComponent.class);
        Class cls = (Class) getIntent().getSerializableExtra("facadeclass");
        if (cls != null) {
            try {
                viewFacade = (ViewFacade) cls.getDeclaredConstructor(XServer.class, ApplicationStateBase.class).newInstance(component.getXServer(), applicationState);
            } catch (Exception unused) {
                Assert.state(ENABLE_TRACING_METHODS);
            }
        } else {
            viewFacade = null;
        }
        getWindow().addFlags(128);
        getWindow().addFlags(4194304);
        setContentView(R.layout.main);
        if (checkForSuddenDeath()) {
            return;
        }
        this.viewOfXServer = new ViewOfXServer(this, component.getXServer(), viewFacade, applicationState.getXServerViewConfiguration());
        this.periodicIabCheckTimer.start();
    }

@ewt45 ewt45 changed the title fix: iIfRegionMaker find the wrong outBlock fix: IfRegionMaker find the wrong outBlock Dec 30, 2024
@skylot
Copy link
Owner

skylot commented Dec 30, 2024

@ewt45 looks good! Thank you 👍

@skylot skylot merged commit 84e211b into skylot:master Dec 30, 2024
4 checks passed
@ewt45 ewt45 deleted the fix-ifregionmaker branch January 1, 2025 02:03
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