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: manually solve dynamic array overflow conditions #366

Merged
merged 7 commits into from
Sep 24, 2024

Conversation

daejunpark
Copy link
Collaborator

@daejunpark daejunpark commented Sep 19, 2024

this pr fixes the false positive warnings of loop unrolling bounds, which were generated during the creation of storage arrays:

contract ATest {
    uint[] numbers;

    function setUp() {
        numbers = new uint[](5);
        ...
    }
}

@daejunpark daejunpark force-pushed the fix/dynamic-array-exceed-storage-limit branch from 9a2a455 to 0cc631a Compare September 21, 2024 08:32
@daejunpark daejunpark marked this pull request as ready for review September 23, 2024 22:50
src/halmos/sevm.py Show resolved Hide resolved
src/halmos/utils.py Outdated Show resolved Hide resolved
left, right = ule.arg(0), ule.arg(1)

# Not(ULE(f_sha3_256(slot), offset + base))
if not (left.decl().name() == "f_sha3_256" and is_app_of(right, Z3_OP_BADD)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this might inadvertently break if the "f_sha3_256" name changes, can we use some well defined symbol rather than a magic string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in edd2dea

@daejunpark daejunpark merged commit 20cd93a into main Sep 24, 2024
57 checks passed
@daejunpark daejunpark deleted the fix/dynamic-array-exceed-storage-limit branch September 24, 2024 23:44
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