Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[SMTChecker] SMT logic error occurs when assigning values to fixed-size bytes array #15770

Closed
lum7na opened this issue Jan 24, 2025 · 0 comments · Fixed by #15810
Closed

[SMTChecker] SMT logic error occurs when assigning values to fixed-size bytes array #15770

lum7na opened this issue Jan 24, 2025 · 0 comments · Fixed by #15810

Comments

@lum7na
Copy link

lum7na commented Jan 24, 2025

This seems to be related to #15701.

Compile: solc a.sol --via-ir --model-checker-invariants contract --model-checker-engine chc
Version: 0.8.29-develop.2025.1.21+commit.d750b9df.Linux.g++

contract c {
    function f(uint len) public returns (bytes memory) {
        bytes memory x = new bytes(len);
        for (uint i = 0; i < len; i++) {
            x[i] = bytes1(uint8(i));
        }
        return x;
    }
}

Output:

SMT logic error:
/solidity/libsmtutil/SolverInterface.h(233): Throw in function static solidity::smtutil::Expression solidity::smtutil::Expression::store(solidity::smtutil::Expression, solidity::smtutil::Expression, solidity::smtutil::Expression)
Dynamic exception type: boost::wrapexcept<solidity::smtutil::SMTLogicError>
std::exception::what: SMT assertion failed
[solidity::util::tag_comment*] = SMT assertion failed
@blishko blishko added the smt label Jan 24, 2025
@blishko blishko changed the title SMT logic error occurs when assigning values to fixed-size bytes array [SMTChecker] SMT logic error occurs when assigning values to fixed-size bytes array Jan 24, 2025
@github-project-automation github-project-automation bot moved this from To Do to Done in SMT Checker Feb 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants