aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-06 03:40:49 +0800
committerGitHub <noreply@github.com>2018-09-06 03:40:49 +0800
commit08a7a51f071e2ef30db011fb36d505c7615785ec (patch)
tree603e8a79d31e552c9e308a87e3d90f3fcccb854d /libsolidity/codegen/ExpressionCompiler.cpp
parent9cb72fe6ca0260e465ed3a1700cc4a890480df4f (diff)
parent87804b6419a5894601441efe511015adda5fb119 (diff)
downloaddexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar.gz
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar.bz2
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar.lz
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar.xz
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.tar.zst
dexon-solidity-08a7a51f071e2ef30db011fb36d505c7615785ec.zip
Merge pull request #4887 from ethereum/addressSplit
Split IntegerType into IntegerType and AddressType.
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 4cc4ba53..4150bc11 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1259,7 +1259,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
identifier = FunctionType(*function).externalIdentifier();
else
solAssert(false, "Contract member is neither variable nor function.");
- utils().convertType(type, IntegerType(160, IntegerType::Modifier::Address), true);
+ utils().convertType(type, AddressType(), true);
m_context << identifier;
}
else
@@ -1268,11 +1268,16 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
}
case Type::Category::Integer:
{
+ solAssert(false, "Invalid member access to integer");
+ break;
+ }
+ case Type::Category::Address:
+ {
if (member == "balance")
{
utils().convertType(
*_memberAccess.expression().annotation().type,
- IntegerType(160, IntegerType::Modifier::Address),
+ AddressType(),
true
);
m_context << Instruction::BALANCE;
@@ -1280,11 +1285,11 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
else if ((set<string>{"send", "transfer", "call", "callcode", "delegatecall", "staticcall"}).count(member))
utils().convertType(
*_memberAccess.expression().annotation().type,
- IntegerType(160, IntegerType::Modifier::Address),
+ AddressType(),
true
);
else
- solAssert(false, "Invalid member access to integer");
+ solAssert(false, "Invalid member access to address");
break;
}
case Type::Category::Function:
@@ -1578,7 +1583,7 @@ void ExpressionCompiler::endVisit(Literal const& _literal)
{
case Type::Category::RationalNumber:
case Type::Category::Bool:
- case Type::Category::Integer:
+ case Type::Category::Address:
m_context << type->literalValue(&_literal);
break;
case Type::Category::StringLiteral: