solidity
solidity copied to clipboard
Interesting case of dangling storage pointers
trafficstars
pragma solidity >=0.5.0;
contract DanglingStorage {
int[][] baz;
function() external payable {
baz.length = 10;
baz[0].length = 10;
int x = baz[0][0];
int[] storage bar = baz[0];
baz.length = 0;
int y = bar[0];
assert(x == y);
}
}
This Solidity code crashes because dereference when assigning y fails (I think). We need to clarify what's going on in this case.