aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-09-03 23:45:58 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-05 18:19:14 +0800
commit87804b6419a5894601441efe511015adda5fb119 (patch)
tree72fc5334d21933570c8b94ec6a22879c98a692ca /libsolidity/codegen/ExpressionCompiler.cpp
parenta996ea266c4542b37503c1d2261a17f3d5a55dbb (diff)
downloaddexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.gz
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.bz2
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.lz
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.xz
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.tar.zst
dexon-solidity-87804b6419a5894601441efe511015adda5fb119.zip
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: