2020-11-12 14:29:08 +00:00
|
|
|
contract c {
|
|
|
|
struct s { uint[][] d; }
|
|
|
|
s[] data;
|
|
|
|
function fill() public returns (uint) {
|
|
|
|
while (data.length < 3)
|
|
|
|
data.push();
|
|
|
|
while (data[2].d.length < 4)
|
|
|
|
data[2].d.push();
|
|
|
|
while (data[2].d[3].length < 5)
|
|
|
|
data[2].d[3].push();
|
|
|
|
data[2].d[3][4] = 8;
|
|
|
|
return data[2].d[3][4];
|
|
|
|
}
|
|
|
|
function clear() public { delete data; }
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
|
|
|
// ----
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 1
|
2020-11-12 14:29:08 +00:00
|
|
|
// fill() -> 8
|
2021-07-01 12:17:27 +00:00
|
|
|
// gas irOptimized: 123113
|
2021-05-18 13:39:08 +00:00
|
|
|
// gas legacy: 121756
|
|
|
|
// gas legacyOptimized: 120687
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 0
|
2020-11-12 14:29:08 +00:00
|
|
|
// clear() ->
|
2021-01-08 03:45:19 +00:00
|
|
|
// storageEmpty -> 1
|