mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
24 lines
427 B
Solidity
24 lines
427 B
Solidity
contract C {
|
|
struct S {
|
|
uint8[] m;
|
|
}
|
|
function f() public pure returns (bool correct) {
|
|
S memory s;
|
|
s.m = new uint8[](1);
|
|
assembly {
|
|
mstore(add(s, 64), 257)
|
|
}
|
|
uint8 x = s.m[0];
|
|
uint r;
|
|
assembly {
|
|
r := x
|
|
}
|
|
correct = r == 0x01;
|
|
}
|
|
}
|
|
// ====
|
|
// compileToEwasm: also
|
|
// compileViaYul: true
|
|
// ----
|
|
// f() -> true
|