Skip to content

Commit

Permalink
SMTChecker: Respect signedness of integer type
Browse files Browse the repository at this point in the history
When creating zero-value expression, we need to respect the signedness of the passed type.
  • Loading branch information
blishko committed Feb 19, 2024
1 parent 8631af2 commit ac39886
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libsolidity/formal/SymbolicTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ smtutil::Expression zeroValue(frontend::Type const* _type)
if (isSupportedType(*_type))
{
if (isNumber(*_type))
return 0;
return isSigned(_type) ? smtutil::Expression(s256(0)) : smtutil::Expression(static_cast<size_t>(0));
if (isBool(*_type))
return smtutil::Expression(false);
if (isArray(*_type) || isMapping(*_type))
Expand Down

0 comments on commit ac39886

Please sign in to comment.