mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[Sol->Yul] Enabling storage pointers to local vars in inline assembly.
This commit is contained in:
+18
@@ -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
|
||||
Reference in New Issue
Block a user