Bytes type cleanup.

This commit is contained in:
Christian
2015-02-12 15:01:38 +01:00
parent 5673f994fc
commit 5e40b79426
3 changed files with 7 additions and 24 deletions
+3 -6
View File
@@ -184,17 +184,14 @@ void CompilerUtils::copyByteArrayToStorage(ByteArrayType const& _targetType,
<< eth::Instruction::SWAP1;
// stack here: target_ref target_data_end target_data_ref
// store length (in bytes)
if (_sourceType.getOffset() == 0)
m_context << eth::Instruction::CALLDATASIZE;
else
m_context << _sourceType.getOffset() << eth::Instruction::CALLDATASIZE << eth::Instruction::SUB;
m_context << eth::Instruction::CALLDATASIZE;
m_context << eth::Instruction::DUP1 << eth::Instruction::DUP5 << eth::Instruction::SSTORE;
// jump to end if length is zero
m_context << eth::Instruction::ISZERO;
eth::AssemblyItem copyLoopEnd = m_context.newTag();
m_context.appendConditionalJumpTo(copyLoopEnd);
m_context << _sourceType.getOffset();
// store start offset
m_context << u256(0);
// stack now: target_ref target_data_end target_data_ref calldata_offset
eth::AssemblyItem copyLoopStart = m_context.newTag();
m_context << copyLoopStart