solidity/test/libsolidity/semanticTests/viaYul/memory_struct_allow.sol
2022-05-19 20:23:28 +02:00

22 lines
479 B
Solidity

contract C {
struct S {
uint256 a;
uint256 b;
}
function f() public pure returns (uint256 a, uint256 b){
assembly {
// Make free memory dirty to check that the struct allocation cleans it up again.
let freeMem := mload(0x40)
mstore(freeMem, 42)
mstore(add(freeMem, 32), 42)
}
S memory s;
return (s.a, s.b);
}
}
// ====
// compileToEwasm: also
// ----
// f() -> 0, 0