Merge pull request #10912 from ethereum/calldataLValueSol2Yul

[Sol->Yul] Check lvalue kind is stack in case of calldata.
This commit is contained in:
Đorđe Mijović 2021-02-08 14:19:24 +01:00 committed by GitHub
commit 4fd5643970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2918,7 +2918,11 @@ void IRGeneratorForStatements::setLValue(Expression const& _expression, IRLValue
solAssert(!m_currentLValue, "");
if (_expression.annotation().willBeWrittenTo)
{
m_currentLValue.emplace(std::move(_lvalue));
if (_lvalue.type.dataStoredIn(DataLocation::CallData))
solAssert(holds_alternative<IRLValue::Stack>(_lvalue.kind), "");
}
else
// Only define the expression, if it will not be written to.
define(_expression, readFromLValue(_lvalue));