[Sol->Yul] Enabling storage pointers to local vars in inline assembly.

This commit is contained in:
Djordje Mijovic
2020-08-26 10:25:42 +02:00
parent bff0f9bda7
commit d99b81ef02
6 changed files with 63 additions and 17 deletions
@@ -0,0 +1,18 @@
contract C {
uint256[] public a;
function f() public returns (uint256) {
uint256[] storage x = a;
uint256 off;
assembly {
sstore(x.slot, 7)
off := x.offset
}
assert(off == 0);
return a.length;
}
}
// ====
// compileViaYul: also
// ----
// f() -> 7