Merge pull request #9020 from ethereum/fixMemoryAssumption

Fix assumption for member not in memory.
This commit is contained in:
chriseth 2020-05-26 10:55:52 +02:00 committed by GitHub
commit f94ad21ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1667,8 +1667,10 @@ string YulUtilFunctions::allocateAndInitializeMemoryStructFunction(StructType co
for (size_t i = 0; i < members.size(); ++i)
{
solAssert(members[i]->memoryHeadSize() == 32, "");
solAssert(members[i]->dataStoredIn(DataLocation::Memory), "");
memberParams[i]["zeroValue"] = zeroValueFunction(*members[i], false);
memberParams[i]["zeroValue"] = zeroValueFunction(
*TypeProvider::withLocationIfReference(DataLocation::Memory, members[i]),
false
);
}
templ("member", memberParams);
return templ.render();