mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[Sol->Yul] Implementing read from storage for array types.
This commit is contained in:
parent
052b97e217
commit
b54273e37e
@ -2203,6 +2203,11 @@ string YulUtilFunctions::readFromStorageValueType(Type const& _type, optional<si
|
||||
|
||||
string YulUtilFunctions::readFromStorageReferenceType(Type const& _type)
|
||||
{
|
||||
if (auto const* arrayType = dynamic_cast<ArrayType const*>(&_type))
|
||||
return copyArrayFromStorageToMemoryFunction(
|
||||
dynamic_cast<ArrayType const&>(*arrayType->copyForLocation(DataLocation::Storage, false)),
|
||||
*arrayType
|
||||
);
|
||||
solUnimplementedAssert(_type.category() == Type::Category::Struct, "");
|
||||
|
||||
string functionName = "read_from_storage_reference_type_" + _type.identifier();
|
||||
|
||||
@ -49,7 +49,8 @@ contract Test {
|
||||
a = s.a[1];
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// testInit() -> 0, 0, 0, 0, true
|
||||
// testCopyRead() -> 1, 2, 3, 4
|
||||
|
||||
Loading…
Reference in New Issue
Block a user