Add usingIdentity option to CompilerUtils::memoryCopy

This commit is contained in:
Alex Beregszaszi 2016-10-20 00:02:44 +01:00 committed by chriseth
parent d0542f0e36
commit 4abc8ab5a9
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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: