diff options
author | chriseth <chris@ethereum.org> | 2018-09-14 06:54:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 06:54:53 +0800 |
commit | 5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07 (patch) | |
tree | b04adc91106ebb5c6ecf5770aba63c5910c42d8b /libsolidity/codegen/ExpressionCompiler.cpp | |
parent | 5cf570e100543415f425de7abb34893a0038ca34 (diff) | |
parent | d0497aacc06524749c20f169dc59d2123f410581 (diff) | |
download | dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar.gz dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar.bz2 dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar.lz dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar.xz dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.tar.zst dexon-solidity-5f4a2d2cad56dee3f7f350d65d24b98d1f4b2b07.zip |
Merge pull request #4849 from lastmjs/develop
Introduce static elementary types to use
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 12 |
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 |