mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[libsolidity] TypeProvider: adds explicit uint256() accessor and removes default params in integerType(...).
This commit is contained in:
committed by
chriseth
parent
59d4f54729
commit
58a45f2cb6
@@ -1206,7 +1206,7 @@ void SMTChecker::assignment(VariableDeclaration const& _variable, smt::Expressio
|
||||
if (type->category() == Type::Category::Integer)
|
||||
addOverflowTarget(OverflowTarget::Type::All, type, _value, _location);
|
||||
else if (type->category() == Type::Category::Address)
|
||||
addOverflowTarget(OverflowTarget::Type::All, TypeProvider::integerType(160), _value, _location);
|
||||
addOverflowTarget(OverflowTarget::Type::All, TypeProvider::uint(160), _value, _location);
|
||||
else if (type->category() == Type::Category::Mapping)
|
||||
arrayAssignment();
|
||||
m_interface->addAssertion(newValue(_variable) == _value);
|
||||
|
||||
@@ -120,7 +120,7 @@ pair<bool, shared_ptr<SymbolicVariable>> dev::solidity::newSymbolicVariable(
|
||||
if (!isSupportedTypeDeclaration(_type))
|
||||
{
|
||||
abstract = true;
|
||||
var = make_shared<SymbolicIntVariable>(TypeProvider::integerType(256), _uniqueName, _solver);
|
||||
var = make_shared<SymbolicIntVariable>(TypeProvider::uint256(), _uniqueName, _solver);
|
||||
}
|
||||
else if (isBool(_type.category()))
|
||||
var = make_shared<SymbolicBoolVariable>(type, _uniqueName, _solver);
|
||||
@@ -143,7 +143,7 @@ pair<bool, shared_ptr<SymbolicVariable>> dev::solidity::newSymbolicVariable(
|
||||
auto rational = dynamic_cast<RationalNumberType const*>(&_type);
|
||||
solAssert(rational, "");
|
||||
if (rational->isFractional())
|
||||
var = make_shared<SymbolicIntVariable>(TypeProvider::integerType(256), _uniqueName, _solver);
|
||||
var = make_shared<SymbolicIntVariable>(TypeProvider::uint256(), _uniqueName, _solver);
|
||||
else
|
||||
var = make_shared<SymbolicIntVariable>(type, _uniqueName, _solver);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ SymbolicAddressVariable::SymbolicAddressVariable(
|
||||
string _uniqueName,
|
||||
smt::SolverInterface& _interface
|
||||
):
|
||||
SymbolicIntVariable(TypeProvider::integerType(160), move(_uniqueName), _interface)
|
||||
SymbolicIntVariable(TypeProvider::uint(160), move(_uniqueName), _interface)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ SymbolicFixedBytesVariable::SymbolicFixedBytesVariable(
|
||||
string _uniqueName,
|
||||
smt::SolverInterface& _interface
|
||||
):
|
||||
SymbolicIntVariable(TypeProvider::integerType(_numBytes * 8), move(_uniqueName), _interface)
|
||||
SymbolicIntVariable(TypeProvider::uint(_numBytes * 8), move(_uniqueName), _interface)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user