solidity/test/libsolidity/semanticTests/storage/packed_storage_overflow.sol

19 lines
378 B
Solidity
Raw Normal View History

contract C {
uint16 x = 0x1234;
uint16 a = 0xffff;
uint16 b;
function f() public returns (uint256, uint256, uint256, uint256) {
2020-09-15 14:16:30 +00:00
unchecked { a++; }
uint256 c = b;
delete b;
2020-09-15 14:16:30 +00:00
unchecked { a -= 2; }
return (x, c, b, a);
}
}
// ====
// compileViaYul: also
2021-04-23 15:59:01 +00:00
// compileToEwasm: also
// ----
// f() -> 0x1234, 0x0, 0x0, 0xfffe