mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix initializing mapping return variables.
This commit is contained in:
parent
be7b2c3725
commit
01d7d50750
@ -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;
|
||||
|
||||
|
@ -17,6 +17,8 @@ contract test {
|
||||
return (a[0], a[1], a[2], b[0], b[1], b[2]);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// g() -> 0, 42, 0, 0, 84, 21
|
||||
// h() -> 0, 42, 0, 0, 84, 17
|
||||
|
Loading…
Reference in New Issue
Block a user