Merge pull request #9602 from ethereum/structMemToStorageSol2Yul

[Sol->Yul] Implementing various copying of structs
This commit is contained in:
chriseth
2020-09-02 13:50:46 +02:00
committed by GitHub
13 changed files with 394 additions and 70 deletions
@@ -314,9 +314,9 @@ bool IRGeneratorForStatements::visit(Assignment const& _assignment)
writeToLValue(*m_currentLValue, value);
m_currentLValue.reset();
if (*_assignment.annotation().type != *TypeProvider::emptyTuple())
if (m_currentLValue->type.category() != Type::Category::Struct && *_assignment.annotation().type != *TypeProvider::emptyTuple())
define(_assignment, value);
m_currentLValue.reset();
return false;
}
@@ -2506,7 +2506,7 @@ void IRGeneratorForStatements::writeToLValue(IRLValue const& _lvalue, IRVariable
offset = std::get<unsigned>(_storage.offset);
m_code <<
m_utils.updateStorageValueFunction(_lvalue.type, offset) <<
m_utils.updateStorageValueFunction(_value.type(), _lvalue.type, offset) <<
"(" <<
_storage.slot <<
(