Merge pull request #9760 from ethereum/sol2YulStorageArrayIndexAccessFix

[Sol->Yul] Fixing storage array index access
This commit is contained in:
chriseth
2020-09-08 16:33:54 +02:00
committed by GitHub
3 changed files with 21 additions and 3 deletions
@@ -12,5 +12,7 @@ contract c {
}
}
// ====
// compileViaYul: also
// ----
// test() -> 1, 2, 3, 4
@@ -0,0 +1,16 @@
contract C {
uint8[33] a;
uint32[9] b;
uint120[3] c;
function f() public returns (uint8, uint32, uint120) {
a[32] = 1; a[31] = 2; a[30] = 3;
b[0] = 1; b[1] = 2; b[2] = 3;
c[2] = 3; c[1] = 1;
return (a[32], b[1], c[2]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 1, 2, 3