diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index 2407fa548..26314e4ad 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -2203,6 +2203,11 @@ string YulUtilFunctions::readFromStorageValueType(Type const& _type, optional(&_type)) + return copyArrayFromStorageToMemoryFunction( + dynamic_cast(*arrayType->copyForLocation(DataLocation::Storage, false)), + *arrayType + ); solUnimplementedAssert(_type.category() == Type::Category::Struct, ""); string functionName = "read_from_storage_reference_type_" + _type.identifier(); diff --git a/test/libsolidity/semanticTests/structs/memory_structs_read_write.sol b/test/libsolidity/semanticTests/structs/memory_structs_read_write.sol index 105f59909..9045a3076 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_read_write.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_read_write.sol @@ -49,7 +49,8 @@ contract Test { a = s.a[1]; } } - +// ==== +// compileViaYul: also // ---- // testInit() -> 0, 0, 0, 0, true // testCopyRead() -> 1, 2, 3, 4