Merge pull request #9905 from ethereum/deleteArrayPackedSol2Yul

[Sol->Yul] Implementing deleting of storage array of types that are packed in storage
This commit is contained in:
chriseth
2020-10-01 16:50:57 +02:00
committed by GitHub
3 changed files with 54 additions and 3 deletions
@@ -0,0 +1,18 @@
contract C {
uint120[] data;
function f() public returns (uint120, uint120, uint120) {
data.push(123);
data.push(234);
data.push(345);
delete data;
assembly {
sstore(data.slot, 3)
}
return (data[0], data[1], data[2]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0, 0, 0