diff --git a/Changelog.md b/Changelog.md index aa3e2951f0d5..7adb71deba07 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,10 @@ Compiler Features: * Standard JSON Interface: Introduce `settings.experimental` setting required for enabling the experimental mode. * Yul EVM Code Transform: Improve stack shuffler performance by fixing a BFS deduplication issue. +Important Bugfixes: +* Code Generator: Fix unchecked multiplication overflow when computing storage slot offsets during element access on arrays whose base type is large enough for the product of the index and the storage size to overflow, which could silently read from or write to incorrect storage slots. +* Evmasm Code Generator: Fix unchecked multiplication overflow when computing the storage size of dynamic arrays during deletion, which could result in `delete` silently leaving stale data in storage. + Bugfixes: diff --git a/docs/bugs.json b/docs/bugs.json index 5f8d1a162732..0a282bdb046e 100644 --- a/docs/bugs.json +++ b/docs/bugs.json @@ -1,4 +1,14 @@ [ + { + "uid": "SOL-2026-2", + "name": "UncheckedArrayStorageSizeOverflow", + "summary": "Operations on storage arrays whose base type is large enough for the product of the element count or index and the storage size to overflow could silently corrupt storage due to unchecked multiplication overflow.", + "description": "When computing storage slot offsets for array operations, the code generators multiply a value (array length or element index) by the storage size of the base type. This multiplication was performed without an overflow check in several places, so when the product exceeded ``2**256``, the result would wrap to a smaller value. This affected two operations: (1) deleting a dynamic storage array (legacy code generator only, the IR code generator already used overflow-checked arithmetic for this), where the clearing loop would process fewer slots than necessary, leaving stale data in storage; (2) accessing an element by index (both code generators), where the access would silently read from or write to an incorrect storage slot, leading to data corruption. The bug required a dynamic storage array whose base type occupies enough slots for the relevant product to overflow (e.g., ``uint256[2**255][]`` where the base type occupies ``2**255`` slots). With the fix, both code generators now revert with an arithmetic overflow panic in these situations.", + "link": "", + "introduced": "0.1.0", + "fixed": "0.8.35", + "severity": "low" + }, { "uid": "SOL-2026-1", "name": "TransientStorageClearingHelperCollision", diff --git a/docs/bugs_by_version.json b/docs/bugs_by_version.json index c5576d4b298e..ee18975d60e1 100644 --- a/docs/bugs_by_version.json +++ b/docs/bugs_by_version.json @@ -1,6 +1,7 @@ { "0.1.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -24,6 +25,7 @@ }, "0.1.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -47,6 +49,7 @@ }, "0.1.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -70,6 +73,7 @@ }, "0.1.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -93,6 +97,7 @@ }, "0.1.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -117,6 +122,7 @@ }, "0.1.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -141,6 +147,7 @@ }, "0.1.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -167,6 +174,7 @@ }, "0.1.7": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -193,6 +201,7 @@ }, "0.2.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -220,6 +229,7 @@ }, "0.2.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -247,6 +257,7 @@ }, "0.2.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -274,6 +285,7 @@ }, "0.3.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -303,6 +315,7 @@ }, "0.3.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -331,6 +344,7 @@ }, "0.3.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -359,6 +373,7 @@ }, "0.3.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -386,6 +401,7 @@ }, "0.3.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -413,6 +429,7 @@ }, "0.3.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -440,6 +457,7 @@ }, "0.3.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -465,6 +483,7 @@ }, "0.4.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -490,6 +509,7 @@ }, "0.4.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -515,6 +535,7 @@ }, "0.4.10": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -539,6 +560,7 @@ }, "0.4.11": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -562,6 +584,7 @@ }, "0.4.12": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -584,6 +607,7 @@ }, "0.4.13": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -606,6 +630,7 @@ }, "0.4.14": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -627,6 +652,7 @@ }, "0.4.15": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -647,6 +673,7 @@ }, "0.4.16": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -670,6 +697,7 @@ }, "0.4.17": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -694,6 +722,7 @@ }, "0.4.18": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -717,6 +746,7 @@ }, "0.4.19": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -741,6 +771,7 @@ }, "0.4.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -765,6 +796,7 @@ }, "0.4.20": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -789,6 +821,7 @@ }, "0.4.21": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -813,6 +846,7 @@ }, "0.4.22": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -837,6 +871,7 @@ }, "0.4.23": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -860,6 +895,7 @@ }, "0.4.24": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -883,6 +919,7 @@ }, "0.4.25": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -904,6 +941,7 @@ }, "0.4.26": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -922,6 +960,7 @@ }, "0.4.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -945,6 +984,7 @@ }, "0.4.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -967,6 +1007,7 @@ }, "0.4.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -992,6 +1033,7 @@ }, "0.4.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -1016,6 +1058,7 @@ }, "0.4.7": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -1040,6 +1083,7 @@ }, "0.4.8": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -1064,6 +1108,7 @@ }, "0.4.9": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "KeccakCaching", @@ -1088,6 +1133,7 @@ }, "0.5.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1109,6 +1155,7 @@ }, "0.5.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1130,6 +1177,7 @@ }, "0.5.10": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1149,6 +1197,7 @@ }, "0.5.11": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1167,6 +1216,7 @@ }, "0.5.12": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1185,6 +1235,7 @@ }, "0.5.13": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1203,6 +1254,7 @@ }, "0.5.14": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1223,6 +1275,7 @@ }, "0.5.15": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1242,6 +1295,7 @@ }, "0.5.16": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1260,6 +1314,7 @@ }, "0.5.17": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1277,6 +1332,7 @@ }, "0.5.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1298,6 +1354,7 @@ }, "0.5.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1319,6 +1376,7 @@ }, "0.5.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1340,6 +1398,7 @@ }, "0.5.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1363,6 +1422,7 @@ }, "0.5.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1386,6 +1446,7 @@ }, "0.5.7": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "DirtyBytesArrayToStorage", "ABIDecodeTwoDimensionalArrayMemory", @@ -1407,6 +1468,7 @@ }, "0.5.8": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1429,6 +1491,7 @@ }, "0.5.9": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1450,6 +1513,7 @@ }, "0.6.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1469,6 +1533,7 @@ }, "0.6.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "AbiReencodingHeadOverflowWithStaticArrayCleanup", "DirtyBytesArrayToStorage", @@ -1487,6 +1552,7 @@ }, "0.6.10": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1504,6 +1570,7 @@ }, "0.6.11": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1521,6 +1588,7 @@ }, "0.6.12": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1538,6 +1606,7 @@ }, "0.6.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "MissingSideEffectsOnSelectorAccess", "AbiReencodingHeadOverflowWithStaticArrayCleanup", @@ -1557,6 +1626,7 @@ }, "0.6.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "MissingSideEffectsOnSelectorAccess", "AbiReencodingHeadOverflowWithStaticArrayCleanup", @@ -1576,6 +1646,7 @@ }, "0.6.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "MissingSideEffectsOnSelectorAccess", "AbiReencodingHeadOverflowWithStaticArrayCleanup", @@ -1595,6 +1666,7 @@ }, "0.6.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "MissingSideEffectsOnSelectorAccess", "AbiReencodingHeadOverflowWithStaticArrayCleanup", @@ -1614,6 +1686,7 @@ }, "0.6.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "MissingSideEffectsOnSelectorAccess", "AbiReencodingHeadOverflowWithStaticArrayCleanup", @@ -1632,6 +1705,7 @@ }, "0.6.7": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1651,6 +1725,7 @@ }, "0.6.8": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1667,6 +1742,7 @@ }, "0.6.9": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1685,6 +1761,7 @@ }, "0.7.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1702,6 +1779,7 @@ }, "0.7.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1720,6 +1798,7 @@ }, "0.7.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1737,6 +1816,7 @@ }, "0.7.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1753,6 +1833,7 @@ }, "0.7.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1768,6 +1849,7 @@ }, "0.7.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1783,6 +1865,7 @@ }, "0.7.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1798,6 +1881,7 @@ }, "0.8.0": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1813,6 +1897,7 @@ }, "0.8.1": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1828,6 +1913,7 @@ }, "0.8.10": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1841,6 +1927,7 @@ }, "0.8.11": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1855,6 +1942,7 @@ }, "0.8.12": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1869,6 +1957,7 @@ }, "0.8.13": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1884,6 +1973,7 @@ }, "0.8.14": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1897,6 +1987,7 @@ }, "0.8.15": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1908,6 +1999,7 @@ }, "0.8.16": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1918,6 +2010,7 @@ }, "0.8.17": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1927,6 +2020,7 @@ }, "0.8.18": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1936,6 +2030,7 @@ }, "0.8.19": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1945,6 +2040,7 @@ }, "0.8.2": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -1960,6 +2056,7 @@ }, "0.8.20": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -1969,6 +2066,7 @@ }, "0.8.21": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication" ], @@ -1976,6 +2074,7 @@ }, "0.8.22": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication" ], @@ -1983,36 +2082,42 @@ }, "0.8.23": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow" ], "released": "2023-11-08" }, "0.8.24": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow" ], "released": "2024-01-25" }, "0.8.25": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow" ], "released": "2024-03-14" }, "0.8.26": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow" ], "released": "2024-05-21" }, "0.8.27": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow" ], "released": "2024-09-04" }, "0.8.28": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision", "LostStorageArrayWriteOnSlotOverflow" ], @@ -2020,6 +2125,7 @@ }, "0.8.29": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision", "LostStorageArrayWriteOnSlotOverflow" ], @@ -2027,6 +2133,7 @@ }, "0.8.3": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -2041,6 +2148,7 @@ }, "0.8.30": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision", "LostStorageArrayWriteOnSlotOverflow" ], @@ -2048,6 +2156,7 @@ }, "0.8.31": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision", "LostStorageArrayWriteOnSlotOverflow" ], @@ -2055,22 +2164,27 @@ }, "0.8.32": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision" ], "released": "2025-12-18" }, "0.8.33": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "TransientStorageClearingHelperCollision" ], "released": "2025-12-18" }, "0.8.34": { - "bugs": [], + "bugs": [ + "UncheckedArrayStorageSizeOverflow" + ], "released": "2026-02-18" }, "0.8.4": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", "MissingSideEffectsOnSelectorAccess", @@ -2084,6 +2198,7 @@ }, "0.8.5": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -2098,6 +2213,7 @@ }, "0.8.6": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -2112,6 +2228,7 @@ }, "0.8.7": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -2126,6 +2243,7 @@ }, "0.8.8": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", @@ -2141,6 +2259,7 @@ }, "0.8.9": { "bugs": [ + "UncheckedArrayStorageSizeOverflow", "LostStorageArrayWriteOnSlotOverflow", "VerbatimInvalidDeduplication", "FullInlinerNonExpressionSplitArgumentEvaluationOrder", diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp index 80ee9553c0ae..92c23781e2d0 100644 --- a/libsolidity/codegen/ArrayUtils.cpp +++ b/libsolidity/codegen/ArrayUtils.cpp @@ -641,7 +641,20 @@ void ArrayUtils::convertLengthToSize(ArrayType const& _arrayType, bool _pad) con } } else - m_context << _arrayType.baseType()->storageSize() << Instruction::MUL; + { + if (!_arrayType.isDynamicallySized()) + // For static arrays, the total size is known at compile time and overflow checked during type validation. + m_context << Instruction::POP << _arrayType.storageSize(); + else + { + m_context << _arrayType.baseType()->storageSize(); + m_context.callYulFunction( + m_context.utilFunctions().overflowCheckedIntMulFunction(*TypeProvider::uint256()), + 2, + 1 + ); + } + } } else { @@ -774,7 +787,14 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType, bool _doBoundsCheck, b else { if (_arrayType.baseType()->storageSize() != 1) - m_context << _arrayType.baseType()->storageSize() << Instruction::MUL; + { + m_context << _arrayType.baseType()->storageSize(); + m_context.callYulFunction( + m_context.utilFunctions().overflowCheckedIntMulFunction(*TypeProvider::uint256()), + 2, + 1 + ); + } m_context << Instruction::ADD << u256(0); } m_context << endTag; diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index bb18217f2f7c..8d4668373497 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -2428,7 +2428,7 @@ std::string YulUtilFunctions::storageArrayIndexAccessFunction(ArrayType const& _ let dataArea := (array) - slot := add(dataArea, mul(index, )) + slot := add(dataArea, (index, )) offset := 0 } @@ -2441,6 +2441,9 @@ std::string YulUtilFunctions::storageArrayIndexAccessFunction(ArrayType const& _ ("multipleItemsPerSlot", _type.baseType()->storageBytes() <= 16) ("isBytesArray", _type.isByteArrayOrString()) ("storageSize", _type.baseType()->storageSize().str()) + ("mul", _type.baseType()->storageSize() > 1 + ? overflowCheckedIntMulFunction(*TypeProvider::uint256()) + : "mul") ("storageBytes", toString(_type.baseType()->storageBytes())) ("itemsPerSlot", std::to_string(32 / _type.baseType()->storageBytes())) .render(); diff --git a/test/libsolidity/semanticTests/array/access_index_storage_overflow.sol b/test/libsolidity/semanticTests/array/access_index_storage_overflow.sol new file mode 100644 index 000000000000..54480fa90603 --- /dev/null +++ b/test/libsolidity/semanticTests/array/access_index_storage_overflow.sol @@ -0,0 +1,14 @@ +contract C { + // Each element occupies 2^255 storage slots. + // push() computes the new element's slot as: keccak256(data.slot) + index * storageSize + // The 3rd push (index 2) overflows: 2 * 2^255 = 2^256 mod 2^256 = 0. + uint256[2**255][] data; + + function test() public { + data.push(); + data.push(); + data.push(); + } +} +// ---- +// test() -> FAILURE, hex"4e487b71", 0x11 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol index 5f1dae910d6b..6b1c3bd74066 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol @@ -35,12 +35,12 @@ contract c { } // ---- // test() -> 0x02000202 -// gas irOptimized: 4560468 -// gas legacy: 4536539 -// gas legacyOptimized: 4456732 +// gas irOptimized: 4560846 +// gas legacy: 4544275 +// gas legacyOptimized: 4459618 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 4488719 -// gas legacy: 4407759 -// gas legacyOptimized: 4385068 +// gas irOptimized: 4490259 +// gas legacy: 4415495 +// gas legacyOptimized: 4388058 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol index 6b1dd7ff02c0..7123f4630d43 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol @@ -21,6 +21,6 @@ contract c { } // ---- // test() -> 3, 4 -// gas irOptimized: 169553 -// gas legacy: 182361 -// gas legacyOptimized: 169554 +// gas irOptimized: 169572 +// gas legacy: 183561 +// gas legacyOptimized: 170186 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol index f1cd76a3adc5..0151ec5bf292 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol @@ -17,7 +17,7 @@ contract c { } // ---- // test() -> 4, 5 -// gas irOptimized: 190676 -// gas legacy: 210706 -// gas legacyOptimized: 190472 +// gas irOptimized: 191814 +// gas legacy: 214988 +// gas legacyOptimized: 192122 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol index ffa0c68adcbe..22b3ff368cc4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol @@ -44,4 +44,4 @@ contract c { // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 // gas irOptimized: 134685 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 111177 +// gas irOptimized: 111283 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol index 933a1ab1b1c5..b259eaa739c4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol @@ -44,7 +44,7 @@ contract Test { // test1() -> 3 // test2() -> 6 // gas irOptimized: 95905 -// gas legacy: 100519 +// gas legacy: 101239 // test3() -> 24 // gas irOptimized: 141297 // gas legacy: 146668 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_element_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_element_calldata_to_storage.sol index f9d14b59edf5..ae06a0b6787b 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_element_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_element_calldata_to_storage.sol @@ -25,5 +25,5 @@ contract C { // ---- // test(uint8[2][2][2]): 1, 2, 3, 4, 5, 6, 7, 8 // test2(uint8[2][2]): 1, 2, 3, 4 -// gas irOptimized: 72076 -// gas legacyOptimized: 72086 +// gas irOptimized: 72184 +// gas legacyOptimized: 72960 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_element_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_element_memory_to_storage.sol index d604a11e6cd4..462ad039e931 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_element_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_element_memory_to_storage.sol @@ -25,5 +25,5 @@ contract C { // ---- // test(uint8[2][2][2]): 1, 2, 3, 4, 5, 6, 7, 8 // test2(uint8[2][2]): 1, 2, 3, 4 -// gas irOptimized: 73031 -// gas legacyOptimized: 73155 +// gas irOptimized: 73091 +// gas legacyOptimized: 74029 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol index 2e3352693a4b..de95e4f0f2c3 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol @@ -77,6 +77,6 @@ contract C { // gas legacyOptimized: 148067 // test3() -> // gas irOptimized: 124300 -// gas legacy: 130649 -// gas legacyOptimized: 125142 +// gas legacy: 131849 +// gas legacyOptimized: 125503 // test4() -> diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index 2a486d256355..0dc03dcc69b1 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206440 -// gas legacy: 211758 -// gas legacyOptimized: 211179 +// gas irOptimized: 206840 +// gas legacy: 215390 +// gas legacyOptimized: 212016 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol index 5ec2cbcf43dc..529773c3781c 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206440 -// gas legacy: 211770 -// gas legacyOptimized: 211191 +// gas irOptimized: 206840 +// gas legacy: 215402 +// gas legacyOptimized: 212030 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol index b37aa96ea6e0..b335bf6c1c92 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol @@ -24,6 +24,6 @@ contract C { } // ---- // f() -> 11, 0x0c, 1, 0x15, 22, 4 -// gas irOptimized: 291212 -// gas legacy: 293398 -// gas legacyOptimized: 290218 +// gas irOptimized: 291336 +// gas legacy: 300614 +// gas legacyOptimized: 292791 diff --git a/test/libsolidity/semanticTests/array/delete/delete_static_array_of_multislot_structs.sol b/test/libsolidity/semanticTests/array/delete/delete_static_array_of_multislot_structs.sol new file mode 100644 index 000000000000..deb44fcf2487 --- /dev/null +++ b/test/libsolidity/semanticTests/array/delete/delete_static_array_of_multislot_structs.sol @@ -0,0 +1,25 @@ +contract C { + struct S { uint256 a; uint256 b; } + S[5] data; + + function fill() public { + data[0] = S(1, 2); + data[4] = S(3, 4); + } + + function get(uint256 i) public view returns (uint256, uint256) { + return (data[i].a, data[i].b); + } + + function clear() public { delete data; } +} +// ---- +// fill() -> +// gas irOptimized: 110009 +// gas legacy: 110395 +// gas legacyOptimized: 110037 +// get(uint256): 0 -> 1, 2 +// get(uint256): 4 -> 3, 4 +// clear() -> +// get(uint256): 0 -> 0, 0 +// get(uint256): 4 -> 0, 0 diff --git a/test/libsolidity/semanticTests/array/delete_dynamic_array_size_overflow.sol b/test/libsolidity/semanticTests/array/delete_dynamic_array_size_overflow.sol new file mode 100644 index 000000000000..164683b31072 --- /dev/null +++ b/test/libsolidity/semanticTests/array/delete_dynamic_array_size_overflow.sol @@ -0,0 +1,31 @@ +contract C { + uint256[2**255][] data; + + function fill() public { + data.push(); + data.push(); + data[0][0] = 111; + data[1][0] = 222; + } + + function get(uint256 idx) public view returns (uint256) { + return data[idx][0]; + } + + function clear() public { + delete data; + } + + function length() public view returns (uint256) { + return data.length; + } +} +// ---- +// fill() -> +// get(uint256): 0 -> 111 +// get(uint256): 1 -> 222 +// length() -> 2 +// clear() -> FAILURE, hex"4e487b71", 0x11 +// get(uint256): 0 -> 111 +// get(uint256): 1 -> 222 +// length() -> 2 diff --git a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol index f96473739fa5..d56e33469292 100644 --- a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol @@ -41,9 +41,9 @@ contract c { // ---- // getLengths() -> 0, 0 // setLengths(uint256,uint256): 48, 49 -> -// gas irOptimized: 112674 -// gas legacy: 108272 -// gas legacyOptimized: 100268 +// gas irOptimized: 116466 +// gas legacy: 120176 +// gas legacyOptimized: 105403 // getLengths() -> 48, 49 // setIDStatic(uint256): 11 -> // getID(uint256): 2 -> 11 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index 4e1e8b4b3db0..9e4970d6140b 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -20,6 +20,6 @@ contract c { } // ---- // test() -> 2, 3, 4, 5 -// gas irOptimized: 135329 -// gas legacy: 139481 -// gas legacyOptimized: 135795 +// gas irOptimized: 135377 +// gas legacy: 140681 +// gas legacyOptimized: 136078 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol index 254c14b061cf..297bf838204e 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5 -// gas irOptimized: 137153 -// gas legacy: 142414 -// gas legacyOptimized: 137975 +// gas irOptimized: 137204 +// gas legacy: 143614 +// gas legacyOptimized: 138270 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index e89eeba986fa..6df9c886a5aa 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -74,17 +74,17 @@ contract FixedFeeRegistrar is Registrar { } // ---- // constructor() -// gas irOptimized: 78076 -// gas irOptimized code: 307400 -// gas legacy: 115395 -// gas legacy code: 792400 -// gas legacyOptimized: 84598 -// gas legacyOptimized code: 388000 +// gas irOptimized: 80911 +// gas irOptimized code: 341400 +// gas legacy: 117121 +// gas legacy code: 818000 +// gas legacyOptimized: 85522 +// gas legacyOptimized code: 399400 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 -// gas irOptimized: 45741 -// gas legacy: 46698 -// gas legacyOptimized: 45948 +// gas irOptimized: 45775 +// gas legacy: 46938 +// gas legacyOptimized: 46031 // owner(string): 0x20, 3, "abc" -> 0x1212121212121212121212121212120000000012 // reserve(string), 70 ether: 0x20, 3, "def" -> // ~ emit Changed(string): #0x34607c9bbfeb9c23509680f04363f298fdb0b5f9abe327304ecd1daca08cda9c diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol index 1e2637c851f9..6577f8826d31 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol @@ -36,19 +36,19 @@ contract C layout at 2**256 - 5 { // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillArray() // gas irOptimized: 220749 -// gas legacy: 221473 -// gas legacyOptimized: 220915 +// gas legacy: 223633 +// gas legacyOptimized: 221752 // partialAssignArrayBeforeStorageBoundary() // x() -> 11, 12, 13, 0, 0, 0, 0, 0, 0, 0 // fillArray() // gas irOptimized: 186549 -// gas legacy: 187273 -// gas legacyOptimized: 186715 +// gas legacy: 189433 +// gas legacyOptimized: 187552 // x() -> 11, 1, 2, 3, 4, 5, 6, 7, 8, 9 // partialAssignArrayCrossStorageBoundary() // x() -> 14, 15, 16, 17, 18, 19, 20, 0, 0, 0 // clearArray() // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // gas irOptimized: 44183 -// gas legacy: 46007 -// gas legacyOptimized: 43907 +// gas legacy: 46247 +// gas legacyOptimized: 44011 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_assignment.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_assignment.sol index 0de66a71472f..c6a38cf3bb5d 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_assignment.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_assignment.sol @@ -17,12 +17,12 @@ contract C { // ---- // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // assignArray(uint256[10]): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> -// gas irOptimized: 245236 -// gas legacy: 249351 -// gas legacyOptimized: 245365 +// gas irOptimized: 245212 +// gas legacy: 249591 +// gas legacyOptimized: 245464 // x() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // assignArray(uint256[10]): 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 -> // x() -> 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 // gas irOptimized: 44183 -// gas legacy: 46012 -// gas legacyOptimized: 43907 +// gas legacy: 46252 +// gas legacyOptimized: 44011 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_copy.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_copy.sol index 949edc4907eb..3f29f856e22b 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_copy.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_copy.sol @@ -45,17 +45,17 @@ contract C { // x() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // y() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // copyXToY() -// gas irOptimized: 264224 -// gas legacy: 265434 -// gas legacyOptimized: 264247 +// gas irOptimized: 264272 +// gas legacy: 265914 +// gas legacyOptimized: 264423 // x() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // y() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // clearX() // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // y() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // copyYToX() -// gas irOptimized: 266243 -// gas legacy: 267456 -// gas legacyOptimized: 266280 +// gas irOptimized: 266291 +// gas legacy: 267936 +// gas legacyOptimized: 266456 // x() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 // y() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_delete.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_delete.sol index 20d2e2ec9df5..26c2bf94fe67 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_delete.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_delete.sol @@ -24,11 +24,11 @@ contract C { // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillArray() // gas irOptimized: 220705 -// gas legacy: 221434 -// gas legacyOptimized: 220871 +// gas legacy: 223594 +// gas legacyOptimized: 221708 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 // clearArray() // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // gas irOptimized: 44183 -// gas legacy: 46012 -// gas legacyOptimized: 43907 +// gas legacy: 46252 +// gas legacyOptimized: 44011 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_delete_overlapping_variable.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_delete_overlapping_variable.sol index 3bb605cc919e..afc9d99a515b 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_delete_overlapping_variable.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_delete_overlapping_variable.sol @@ -28,13 +28,13 @@ contract C { // x() -> 0, 0, 0, 0, 0, 42, 0, 0, 0, 0 // fillArray() // gas irOptimized: 203627 -// gas legacy: 204356 -// gas legacyOptimized: 203793 +// gas legacy: 206516 +// gas legacyOptimized: 204630 // y() -> 5 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 // clearArray() // y() -> 0 // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // gas irOptimized: 44183 -// gas legacy: 46012 -// gas legacyOptimized: 43907 +// gas legacy: 46252 +// gas legacyOptimized: 44011 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol index c4e3ee7794c0..297a05b140c7 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol @@ -29,13 +29,13 @@ contract C { // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillArray() // gas irOptimized: 220727 -// gas legacy: 221456 -// gas legacyOptimized: 220893 +// gas legacy: 223616 +// gas legacyOptimized: 221730 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 // partialAssignArrayCrossStorageBoundary() // x() -> 11, 12, 13, 14, 15, 16, 17, 0, 0, 0 // partialAssignArrayBeforeStorageBoundary() // x() -> 21, 22, 23, 0, 0, 0, 0, 0, 0, 0 // gas irOptimized: 44183 -// gas legacy: 46012 -// gas legacyOptimized: 43907 +// gas legacy: 46252 +// gas legacyOptimized: 44011 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol b/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol index 09aae988e511..8fb941306b27 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol @@ -51,30 +51,30 @@ contract C { // ---- // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 -// gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas irOptimized: 604153 +// gas legacy: 645223 +// gas legacyOptimized: 598107 // fillArray() -// gas irOptimized: 5782148 -// gas legacy: 6044562 -// gas legacyOptimized: 5853893 +// gas irOptimized: 5793623 +// gas legacy: 6105762 +// gas legacyOptimized: 5875058 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 -// gas irOptimized: 604108 -// gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas irOptimized: 604153 +// gas legacy: 645223 +// gas legacyOptimized: 598107 // partialAssignArray() -// gas irOptimized: 1067376 -// gas legacy: 1177356 -// gas legacyOptimized: 1068067 +// gas irOptimized: 1067412 +// gas legacy: 1177548 +// gas legacyOptimized: 1068133 // x() -> 11, 22, 33, 44, 55, 66, 77, 88, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 -// gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas irOptimized: 604153 +// gas legacy: 645223 +// gas legacyOptimized: 598107 // clearArray() -// gas irOptimized: 580378 -// gas legacy: 582973 -// gas legacyOptimized: 581299 +// gas irOptimized: 580423 +// gas legacy: 583213 +// gas legacyOptimized: 581379 // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 -// gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas irOptimized: 604153 +// gas legacy: 645223 +// gas legacyOptimized: 598107 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol b/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol index aa30a2bcac49..8abc489d0c79 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol @@ -23,13 +23,13 @@ contract C { // ---- // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillArray() -// gas irOptimized: 254227 -// gas legacy: 258712 -// gas legacyOptimized: 257258 +// gas irOptimized: 254464 +// gas legacy: 268072 +// gas legacyOptimized: 260885 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 // clearArray() -// gas irOptimized: 57426 +// gas irOptimized: 57407 // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // gas irOptimized: 48087 -// gas legacy: 64080 -// gas legacyOptimized: 56602 +// gas legacy: 64320 +// gas legacyOptimized: 56704 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol index 444f86286453..47ac063f5180 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol @@ -98,75 +98,75 @@ contract C { // ---- // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 // fillBoundaryArray() -// gas irOptimized: 912522 -// gas legacy: 930728 -// gas legacyOptimized: 916628 +// gas irOptimized: 913558 +// gas legacy: 935528 +// gas legacyOptimized: 918238 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 // copyFromBoundary() -// gas irOptimized: 994579 -// gas legacy: 1023407 -// gas legacyOptimized: 994746 +// gas irOptimized: 994627 +// gas legacy: 1023887 +// gas legacyOptimized: 994938 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 // fillDestArray() -// gas irOptimized: 200426 -// gas legacy: 218746 -// gas legacyOptimized: 204648 +// gas irOptimized: 201462 +// gas legacy: 223546 +// gas legacyOptimized: 206258 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 // copyToBoundary() -// gas irOptimized: 282623 -// gas legacy: 311362 -// gas legacyOptimized: 282712 +// gas irOptimized: 282671 +// gas legacy: 311842 +// gas legacyOptimized: 282904 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 // deleteBoundaryArray() -// gas irOptimized: 177968 -// gas legacy: 180995 -// gas legacyOptimized: 178182 +// gas irOptimized: 177828 +// gas legacy: 181180 +// gas legacyOptimized: 178259 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113169 -// gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas irOptimized: 113181 +// gas legacy: 123382 +// gas legacyOptimized: 113519 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 -// gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas irOptimized: 113090 +// gas legacy: 123378 +// gas legacyOptimized: 113517 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol index 05ad53cf0bfa..1b42bb9141e2 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol @@ -92,37 +92,37 @@ contract C { // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillBoundaryArray() -// gas irOptimized: 688719 -// gas legacy: 700075 -// gas legacyOptimized: 691605 +// gas irOptimized: 689835 +// gas legacy: 704875 +// gas legacyOptimized: 693275 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // copyFromBoundary() -// gas irOptimized: 748779 -// gas legacy: 767297 -// gas legacyOptimized: 748756 +// gas irOptimized: 748827 +// gas legacy: 767777 +// gas legacyOptimized: 748948 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // destArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // fillDestArray() -// gas irOptimized: 175623 -// gas legacy: 187093 -// gas legacyOptimized: 178625 +// gas irOptimized: 176739 +// gas legacy: 191893 +// gas legacyOptimized: 180295 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // destArray() -> 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 // copyToBoundary() -// gas irOptimized: 235823 -// gas legacy: 254252 -// gas legacyOptimized: 235722 +// gas irOptimized: 235871 +// gas legacy: 254732 +// gas legacyOptimized: 235914 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 // destArray() -> 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 // deleteBoundaryArray() -// gas irOptimized: 137824 -// gas legacy: 137971 -// gas legacyOptimized: 137750 +// gas irOptimized: 137732 +// gas legacy: 138156 +// gas legacyOptimized: 137827 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // destArray() -> 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol index 5b4085acf8f9..22115c81605e 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol @@ -96,29 +96,29 @@ contract C { // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillBoundaryArray() -// gas irOptimized: 248990 -// gas legacy: 272856 -// gas legacyOptimized: 253856 +// gas irOptimized: 249186 +// gas legacy: 275256 +// gas legacyOptimized: 254786 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // copyFromBoundary() -// gas irOptimized: 274279 -// gas legacy: 298927 -// gas legacyOptimized: 272256 +// gas irOptimized: 274207 +// gas legacy: 299407 +// gas legacyOptimized: 272448 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // destArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // fillDestArray() -// gas legacy: 101874 +// gas legacy: 104274 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // destArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 -// gas legacy: 59729 +// gas legacy: 59969 // copyToBoundary() -// gas irOptimized: 103323 -// gas legacy: 127882 -// gas legacyOptimized: 101222 +// gas irOptimized: 103251 +// gas legacy: 128362 +// gas legacyOptimized: 101414 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 // destArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol index 12cbf0799e04..13aabaeb8659 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol @@ -33,4 +33,4 @@ contract C { // compileViaYul: true // ---- // f() -> 0, 0, 0 -// gas irOptimized: 93835 +// gas irOptimized: 93966