mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove m_code from IRValue
Only one place to append to m_code avoids confusion and bugs
This commit is contained in:
committed by
chriseth
parent
1d75770700
commit
f5980f08cc
@@ -131,7 +131,7 @@ bool IRGeneratorForStatements::visit(Assignment const& _assignment)
|
||||
|
||||
_assignment.leftHandSide().accept(*this);
|
||||
solAssert(!!m_currentLValue, "LValue not retrieved.");
|
||||
m_currentLValue->storeValue(intermediateValue, *intermediateType);
|
||||
m_code << m_currentLValue->storeValue(intermediateValue, *intermediateType);
|
||||
m_currentLValue.reset();
|
||||
|
||||
defineExpression(_assignment) << intermediateValue << "\n";
|
||||
@@ -672,7 +672,6 @@ void IRGeneratorForStatements::endVisit(IndexAccess const& _indexAccess)
|
||||
templ("key", ", " + m_context.variable(*_indexAccess.indexExpression()));
|
||||
m_code << templ.render();
|
||||
setLValue(_indexAccess, make_unique<IRStorageItem>(
|
||||
m_code,
|
||||
m_context,
|
||||
slot,
|
||||
0,
|
||||
@@ -728,9 +727,9 @@ void IRGeneratorForStatements::endVisit(Identifier const& _identifier)
|
||||
solUnimplementedAssert(!varDecl->isConstant(), "");
|
||||
unique_ptr<IRLValue> lvalue;
|
||||
if (m_context.isLocalVariable(*varDecl))
|
||||
lvalue = make_unique<IRLocalVariable>(m_code, m_context, *varDecl);
|
||||
lvalue = make_unique<IRLocalVariable>(m_context, *varDecl);
|
||||
else if (m_context.isStateVariable(*varDecl))
|
||||
lvalue = make_unique<IRStorageItem>(m_code, m_context, *varDecl);
|
||||
lvalue = make_unique<IRStorageItem>(m_context, *varDecl);
|
||||
else
|
||||
solAssert(false, "Invalid variable kind.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user