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

Add havoc tests #217

Open
DavePearce opened this issue Sep 29, 2023 · 1 comment
Open

Add havoc tests #217

DavePearce opened this issue Sep 29, 2023 · 1 comment

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Sep 29, 2023

Given that we can now infer the position of havoc statements, this means we can also now test the inference algorithm. Some tests to start with:

.code
        push 0x10
        calldatasize
        push loop
        jumpi
        pop
        push 0x5
loop:
        jumpdest
        havoc 0
        dup1
        iszero
        push exit
        jumpi
        push 0x1
        swap1
        sub
        push loop
        jump
exit:
        stop
.code
        calldatasize
        push 0x0
loop:
        jumpdest
        dup2
        dup2
        eq
        push exit
        jumpi
        push 0x1
        add
        push loop
        jump
exit:
        stop
@DavePearce
Copy link
Collaborator Author

And another:

.code
        calldatasize
loop:
        jumpdest
        dup1
        iszero
        push exit
        jumpi
        push 0x1
        dup2
        sub
        swap1
        pop
        push loop
        jump
exit:
        stop

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

No branches or pull requests

1 participant