Merge pull request #9849 from ethereum/fixIce9817

Fixing ICE on returning struct with mapping from library
This commit is contained in:
chriseth
2020-10-14 00:05:19 +02:00
committed by GitHub
4 changed files with 31 additions and 5 deletions
+4 -1
View File
@@ -3001,8 +3001,11 @@ TypePointers FunctionType::returnParameterTypesWithoutDynamicTypes() const
m_kind == Kind::BareStaticCall
)
for (auto& param: returnParameterTypes)
if (param->isDynamicallyEncoded() && !param->dataStoredIn(DataLocation::Storage))
{
solAssert(param->decodingType(), "");
if (param->decodingType()->isDynamicallyEncoded())
param = TypeProvider::inaccessibleDynamic();
}
return returnParameterTypes;
}
+5 -4
View File
@@ -41,16 +41,17 @@ ReturnInfo::ReturnInfo(EVMVersion const& _evmVersion, FunctionType const& _funct
returnTypes = _functionType.returnParameterTypesWithoutDynamicTypes();
for (auto const& retType: returnTypes)
if (retType->isDynamicallyEncoded())
{
solAssert(retType->decodingType(), "");
if (retType->decodingType()->isDynamicallyEncoded())
{
solAssert(haveReturndatacopy, "");
dynamicReturnSize = true;
estimatedReturnSize = 0;
break;
}
else if (retType->decodingType())
estimatedReturnSize += retType->decodingType()->calldataEncodedSize();
else
estimatedReturnSize += retType->calldataEncodedSize();
estimatedReturnSize += retType->decodingType()->calldataEncodedSize();
}
}
}