mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixing additional signedness errors after adding -Wsign-conversion flag
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
co-authored by
Kamil Śliwak
parent
3c57e04751
commit
547590b972
@@ -191,7 +191,7 @@ CVC4::Expr CVC4Interface::toCVC4Expr(Expression const& _expr)
|
||||
return m_context.mkExpr(CVC4::kind::BITVECTOR_AND, arguments[0], arguments[1]);
|
||||
else if (n == "int2bv")
|
||||
{
|
||||
size_t size = std::stoi(_expr.arguments[1].name);
|
||||
size_t size = std::stoul(_expr.arguments[1].name);
|
||||
auto i2bvOp = m_context.mkConst(CVC4::IntToBitVector(size));
|
||||
// CVC4 treats all BVs as unsigned, so we need to manually apply 2's complement if needed.
|
||||
return m_context.mkExpr(
|
||||
|
||||
@@ -139,7 +139,7 @@ string SMTLib2Interface::toSExpr(Expression const& _expr)
|
||||
std::string sexpr = "(";
|
||||
if (_expr.name == "int2bv")
|
||||
{
|
||||
size_t size = std::stoi(_expr.arguments[1].name);
|
||||
size_t size = std::stoul(_expr.arguments[1].name);
|
||||
auto arg = toSExpr(_expr.arguments.front());
|
||||
auto int2bv = "(_ int2bv " + to_string(size) + ")";
|
||||
// Some solvers treat all BVs as unsigned, so we need to manually apply 2's complement if needed.
|
||||
|
||||
@@ -184,7 +184,7 @@ z3::expr Z3Interface::toZ3Expr(Expression const& _expr)
|
||||
return arguments[0] & arguments[1];
|
||||
else if (n == "int2bv")
|
||||
{
|
||||
size_t size = std::stoi(_expr.arguments[1].name);
|
||||
size_t size = std::stoul(_expr.arguments[1].name);
|
||||
return z3::int2bv(size, arguments[0]);
|
||||
}
|
||||
else if (n == "bv2int")
|
||||
|
||||
Reference in New Issue
Block a user