aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorJordan Last <jordan.michael.last@gmail.com>2018-09-14 04:29:12 +0800
committerJordan Last <jordan.michael.last@gmail.com>2018-09-14 05:53:06 +0800
commitd0497aacc06524749c20f169dc59d2123f410581 (patch)
tree049e546794c62895b92da4bf1b607bc5310915bb /libsolidity/codegen
parente7daed68c1977683546ac3e72d4f84ff538f6711 (diff)
downloaddexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar.gz
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar.bz2
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar.lz
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar.xz
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.tar.zst
dexon-solidity-d0497aacc06524749c20f169dc59d2123f410581.zip
fixing rebase conflicts
add ElementaryTypes::BytesMemory and ElementaryTypes::StringMemory fix rebase conflicts fixing rebase conflicts use make_shared instead of new fix tabs and StateMutability parameter create address and addressType functions, fix spaces in comment fix typo and switch nonpayable to payable fix spaces fix comment again
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index bd863e05..8645f653 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -710,9 +710,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
arguments.front()->accept(*this);
// Optimization: If type is bytes or string, then do not encode,
// but directly compute keccak256 on memory.
- if (*argType == ArrayType(DataLocation::Memory) || *argType == ArrayType(DataLocation::Memory, true))
+ if (*argType == ArrayType::bytesMemory() || *argType == ArrayType::stringMemory())
{
- ArrayUtils(m_context).retrieveLength(ArrayType(DataLocation::Memory));
+ ArrayUtils(m_context).retrieveLength(ArrayType::bytesMemory());
m_context << Instruction::SWAP1 << u256(0x20) << Instruction::ADD;
}
else
@@ -1086,7 +1086,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
utils().abiDecode(targetTypes, false);
else
{
- utils().convertType(*firstArgType, ArrayType(DataLocation::Memory));
+ utils().convertType(*firstArgType, ArrayType::bytesMemory());
m_context << Instruction::DUP1 << u256(32) << Instruction::ADD;
m_context << Instruction::SWAP1 << Instruction::MLOAD;
// stack now: <mem_pos> <length>
@@ -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, AddressType(type.isPayable() ? StateMutability::Payable : StateMutability::NonPayable), true);
+ utils().convertType(type, type.isPayable() ? AddressType::addressPayable() : AddressType::address(), true);
m_context << identifier;
}
else
@@ -1277,7 +1277,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
{
utils().convertType(
*_memberAccess.expression().annotation().type,
- AddressType(StateMutability::NonPayable),
+ AddressType::address(),
true
);
m_context << Instruction::BALANCE;
@@ -1294,7 +1294,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
else if ((set<string>{"call", "callcode", "delegatecall", "staticcall"}).count(member))
utils().convertType(
*_memberAccess.expression().annotation().type,
- AddressType(StateMutability::NonPayable),
+ AddressType::address(),
true
);
else