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

SMT logic error from incorrect handling of fixed bytes to user defined value type conversion #15888

Open
lum7na opened this issue Feb 25, 2025 · 0 comments

Comments

@lum7na
Copy link

lum7na commented Feb 25, 2025

Hi! Compiling the following Solidity code with solc a.sol --model-checker-engine all results in a SMT logic error.

type MyBytes is bytes2;

contract C {
  MyBytes b = MyBytes.wrap("ab");
}

Output:

SMT logic error:
/solidity/libsmtutil/SolverInterface.h(393): Throw in function solidity::smtutil::Expression solidity::smtutil::operator==(Expression, Expression)
Dynamic exception type: boost::wrapexcept<solidity::smtutil::SMTLogicError>
std::exception::what: Trying to create an 'equal' expression with different sorts
[solidity::util::tag_comment*] = Trying to create an 'equal' expression with different sorts

Both solc 0.8.29-develop.2025.2.25+commit.eb216716.Linux.g++, solc-0.8.27 and solc-0.8.28 can reproduce this bug.

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