Fix initializing mapping return variables.

This commit is contained in:
chriseth
2020-11-11 18:08:42 +01:00
parent be7b2c3725
commit 01d7d50750
2 changed files with 5 additions and 1 deletions
@@ -208,7 +208,9 @@ void IRGeneratorForStatements::initializeLocalVar(VariableDeclaration const& _va
solAssert(m_context.isLocalVariable(_varDecl), "Must be a local variable.");
auto const* type = _varDecl.type();
if (auto const* refType = dynamic_cast<ReferenceType const*>(type))
if (dynamic_cast<MappingType const*>(type))
return;
else if (auto const* refType = dynamic_cast<ReferenceType const*>(type))
if (refType->dataStoredIn(DataLocation::Storage) && refType->isPointer())
return;