mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[Sol->Yul] Check lvalue kind is stack in case of calldata.
This commit is contained in:
parent
706f5d9874
commit
e53feaedc4
@ -2918,7 +2918,11 @@ void IRGeneratorForStatements::setLValue(Expression const& _expression, IRLValue
|
|||||||
solAssert(!m_currentLValue, "");
|
solAssert(!m_currentLValue, "");
|
||||||
|
|
||||||
if (_expression.annotation().willBeWrittenTo)
|
if (_expression.annotation().willBeWrittenTo)
|
||||||
|
{
|
||||||
m_currentLValue.emplace(std::move(_lvalue));
|
m_currentLValue.emplace(std::move(_lvalue));
|
||||||
|
if (_lvalue.type.dataStoredIn(DataLocation::CallData))
|
||||||
|
solAssert(holds_alternative<IRLValue::Stack>(_lvalue.kind), "");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
// Only define the expression, if it will not be written to.
|
// Only define the expression, if it will not be written to.
|
||||||
define(_expression, readFromLValue(_lvalue));
|
define(_expression, readFromLValue(_lvalue));
|
||||||
|
Loading…
Reference in New Issue
Block a user