Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions libsolidity/codegen/ArrayUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ void ArrayUtils::copyArrayToStorage(ArrayType const& _targetType, ArrayType cons
"Copying nested calldata dynamic arrays to storage is not implemented in the old code generator."
);
}
else
{
// TODO: This limitation can now be removed since we use Yul utility functions that handle non-value types correctly.
// The old inline assembly implementation couldn't handle copying arrays of non-value types from memory or calldata to storage,
// but the Yul functions support them. We keep this check temporarily for backward compatibility.
bool fromMemoryOrCalldata = _sourceType.location() == DataLocation::Memory || _sourceType.location() == DataLocation::CallData;
solUnimplementedAssert(
_sourceType.baseType()->isValueType() || !fromMemoryOrCalldata,
"Copying of type " + _sourceType.toString(false) + " to storage is not supported in legacy (only supported by the IR pipeline). " +
"Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON)."
);
}

if (haveSourceLengthOnStack)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma abicoder v2;
pragma abicoder v2;

contract C {
struct S {
Expand All @@ -13,8 +13,8 @@ contract C {
return (s[2].a, s[1].b, s[0].c);
}
}
// ====
// compileViaYul: true
// ----
// f((uint128,uint64,uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12
// gas irOptimized: 120751
// gas legacy: 126254
// gas legacyOptimized: 121447
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ contract C {
return (s[2].a, s[1].b, s[0].c);
}
}
// ====
// compileViaYul: true
// ----
// f() -> 10, 11, 12
// gas irOptimized: 118796
// gas legacy: 124947
// gas legacyOptimized: 119164
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma abicoder v2;
pragma abicoder v2;

contract C {
struct S {
Expand All @@ -19,8 +19,8 @@ contract C {
return (s[1].a.length, s[1].a[0]);
}
}
// ====
// compileViaYul: true
// ----
// f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1
// gas irOptimized: 327461
// gas legacy: 332254
// gas legacyOptimized: 327667
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma abicoder v2;
pragma abicoder v2;

contract C {
struct S {
Expand All @@ -22,8 +22,8 @@ contract C {
return (s[1].b.length, s[1].c.length, s[1].b[2], s[1].c[0]);
}
}
// ====
// compileViaYul: true
// ----
// f() -> 3, 3, 3, 1
// gas irOptimized: 181928
// gas legacy: 190874
// gas legacyOptimized: 183072

This file was deleted.

This file was deleted.