diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-20 07:02:44 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-12-12 00:57:15 +0800 |
commit | 4abc8ab5a9c1d2505cf781796f65de457028514d (patch) | |
tree | 20c9c0c6acaf864709a0624215e06d74ff59e8ec /libsolidity/codegen | |
parent | d0542f0e369a95ed2ae2a02cec2a199e3844c885 (diff) | |
download | dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar.gz dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar.bz2 dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar.lz dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar.xz dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.tar.zst dexon-solidity-4abc8ab5a9c1d2505cf781796f65de457028514d.zip |
Add usingIdentity option to CompilerUtils::memoryCopy
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 9 | ||||
-rw-r--r-- | libsolidity/codegen/CompilerUtils.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index 7c159ff7..461803fa 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -298,9 +298,16 @@ void CompilerUtils::zeroInitialiseMemoryArray(ArrayType const& _type) m_context << Instruction::SWAP1 << Instruction::POP; } -void CompilerUtils::memoryCopy() +void CompilerUtils::memoryCopy(bool _useIdentityPrecompile) { // Stack here: size target source + + if (!_useIdentityPrecompile) + { + // FIXME + return; + } + // stack for call: outsize target size source value contract gas //@TODO do not use ::CALL if less than 32 bytes? m_context << Instruction::DUP3 << Instruction::SWAP1; diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 0a5d8e1c..fdcd1dfc 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -112,7 +112,7 @@ public: /// Uses a CALL to the identity contract to perform a memory-to-memory copy. /// Stack pre: <size> <target> <source> /// Stack post: - void memoryCopy(); + void memoryCopy(bool _useIdentityPrecompile = true); /// Converts the combined and left-aligned (right-aligned if @a _rightAligned is true) /// external function type <address><function identifier> into two stack slots: |