aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal/SymbolicAddressVariable.cpp
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-10-18 21:03:52 +0800
committerLeonardo Alt <leo@ethereum.org>2018-10-19 21:52:16 +0800
commitb46b827c30584968c6815b456b8c0c775c35ae48 (patch)
tree7ea55c6c685cc81779d5dd7bc3f44da22918840e /libsolidity/formal/SymbolicAddressVariable.cpp
parentc13b5280c1b44f18a2a1fb61ef5556e91c5678e7 (diff)
downloaddexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar.gz
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar.bz2
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar.lz
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar.xz
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.tar.zst
dexon-solidity-b46b827c30584968c6815b456b8c0c775c35ae48.zip
[SMTChecker] Support msg.*, tx.*, block.*, gasleft and blockhash
Diffstat (limited to 'libsolidity/formal/SymbolicAddressVariable.cpp')
-rw-r--r--libsolidity/formal/SymbolicAddressVariable.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/libsolidity/formal/SymbolicAddressVariable.cpp b/libsolidity/formal/SymbolicAddressVariable.cpp
index 68b95080..67a18540 100644
--- a/libsolidity/formal/SymbolicAddressVariable.cpp
+++ b/libsolidity/formal/SymbolicAddressVariable.cpp
@@ -24,18 +24,17 @@ using namespace dev;
using namespace dev::solidity;
SymbolicAddressVariable::SymbolicAddressVariable(
- Type const& _type,
string const& _uniqueName,
smt::SolverInterface& _interface
):
- SymbolicIntVariable(_type, _uniqueName, _interface)
+ SymbolicIntVariable(make_shared<IntegerType>(160), _uniqueName, _interface)
{
- solAssert(isAddress(_type.category()), "");
}
void SymbolicAddressVariable::setUnknownValue()
{
- IntegerType intType{160};
- m_interface.addAssertion(currentValue() >= minValue(intType));
- m_interface.addAssertion(currentValue() <= maxValue(intType));
+ auto intType = dynamic_cast<IntegerType const*>(m_type.get());
+ solAssert(intType, "");
+ m_interface.addAssertion(currentValue() >= minValue(*intType));
+ m_interface.addAssertion(currentValue() <= maxValue(*intType));
}