[Sol->Yul] Implementing struct copying from memory to storage

This commit is contained in:
Djordje Mijovic
2020-09-02 12:28:53 +02:00
parent 5e66583b0b
commit b89c863e11
6 changed files with 108 additions and 18 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;
}
@@ -2486,7 +2486,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(_lvalue.type, &_value.type(), offset) <<
"(" <<
_storage.slot <<
(