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 basicBlockContinuation after else #1190

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

Hecate2
Copy link
Contributor

@Hecate2 Hecate2 commented Oct 2, 2024

In the original codes, if I have a contract like this:

if True:
    A()
else:
    B()
C()

A() is covered, and then the address jumps to C(). When C() is covered and returned to the jump stack at the end of A(), we try to cover B(). B() ends at the beginning of C(), hitting the coverage cache at C() (because C() had been covered from A()), and forgets to register the basic block continuation from B() to C().

@Jim8y
Copy link
Contributor

Jim8y commented Oct 2, 2024

any way to test your change?

Jim8y
Jim8y previously approved these changes Oct 2, 2024
@Hecate2
Copy link
Contributor Author

Hecate2 commented Oct 2, 2024

any way to test your change?

I can add some

@Hecate2
Copy link
Contributor Author

Hecate2 commented Oct 2, 2024

Except Contract_Abort, there is no compiler test contract that runs a complete if-else. However Contract_Abort tests will conflict with #1185 . The instruction positions are changed without class contructors.

@Jim8y Jim8y merged commit 112a30c into neo-project:master Oct 5, 2024
3 of 4 checks passed
@Jim8y Jim8y deleted the fix-basic-block-after-else branch October 5, 2024 11:08
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.

3 participants