aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-27 05:46:33 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-27 05:46:33 +0800
commitee65ecfb3b80d9c027bade21df883e897b1234c5 (patch)
treee6343638f4450f532a0605d02b1b6b51192763ad /libsolidity/codegen
parenteb5a6aacd993e3782eaf0c0f9dbce03a0567512f (diff)
downloaddexon-solidity-ee65ecfb3b80d9c027bade21df883e897b1234c5.tar.gz
dexon-solidity-ee65ecfb3b80d9c027bade21df883e897b1234c5.tar.zst
dexon-solidity-ee65ecfb3b80d9c027bade21df883e897b1234c5.zip
Ensure that address types are always declared as 160bit
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ABIFunctions.cpp4
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp2
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp
index 9f6c55ba..22b620e1 100644
--- a/libsolidity/codegen/ABIFunctions.cpp
+++ b/libsolidity/codegen/ABIFunctions.cpp
@@ -162,7 +162,7 @@ string ABIFunctions::cleanupFunction(Type const& _type, bool _revertOnFailure)
break;
}
case Type::Category::Contract:
- templ("body", "cleaned := " + cleanupFunction(IntegerType(0, IntegerType::Modifier::Address)) + "(value)");
+ templ("body", "cleaned := " + cleanupFunction(IntegerType(160, IntegerType::Modifier::Address)) + "(value)");
break;
case Type::Category::Enum:
{
@@ -243,7 +243,7 @@ string ABIFunctions::conversionFunction(Type const& _from, Type const& _to)
toCategory == Type::Category::Integer ||
toCategory == Type::Category::Contract,
"");
- IntegerType const addressType(0, IntegerType::Modifier::Address);
+ IntegerType const addressType(160, IntegerType::Modifier::Address);
IntegerType const& to =
toCategory == Type::Category::Integer ?
dynamic_cast<IntegerType const&>(_to) :
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index c1171c1d..ce97ed61 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -541,7 +541,7 @@ void CompilerUtils::convertType(
else
{
solAssert(targetTypeCategory == Type::Category::Integer || targetTypeCategory == Type::Category::Contract, "");
- IntegerType addressType(0, IntegerType::Modifier::Address);
+ IntegerType addressType(160, IntegerType::Modifier::Address);
IntegerType const& targetType = targetTypeCategory == Type::Category::Integer
? dynamic_cast<IntegerType const&>(_targetType) : addressType;
if (stackTypeCategory == Type::Category::RationalNumber)
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index b286594a..58c64bce 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1040,7 +1040,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(0, IntegerType::Modifier::Address), true);
+ utils().convertType(type, IntegerType(160, IntegerType::Modifier::Address), true);
m_context << identifier;
}
else
@@ -1057,7 +1057,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
{
utils().convertType(
*_memberAccess.expression().annotation().type,
- IntegerType(0, IntegerType::Modifier::Address),
+ IntegerType(160, IntegerType::Modifier::Address),
true
);
m_context << Instruction::BALANCE;
@@ -1065,7 +1065,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
else if ((set<string>{"send", "transfer", "call", "callcode", "delegatecall"}).count(member))
utils().convertType(
*_memberAccess.expression().annotation().type,
- IntegerType(0, IntegerType::Modifier::Address),
+ IntegerType(160, IntegerType::Modifier::Address),
true
);
else