Merge pull request #9652 from ethereum/iceInlineAssemblyOffset

[Sol->Yul] Enabling storage pointers to local vars in inline assembly.
This commit is contained in:
chriseth
2020-08-26 17:12:54 +02:00
committed by GitHub
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