Do not store immutables packed.

This commit is contained in:
chriseth
2021-09-29 10:12:05 +02:00
parent ed7884e341
commit 90f4ca1048
5 changed files with 50 additions and 7 deletions
@@ -0,0 +1,15 @@
contract C {
int8 immutable a = -2;
bytes2 immutable b = "ab";
function() internal returns (uint) immutable f = g;
function viaasm() view external returns (bytes32 x, bytes32 y) {
int8 _a = a;
bytes2 _b = b;
assembly { x := _a y := _b }
}
function g() internal pure returns (uint) { return 2; }
}
// ====
// compileViaYul: also
// ----
// viaasm() -> 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe, 0x6162000000000000000000000000000000000000000000000000000000000000