mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			478 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			478 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);
 | |
|     }
 | |
| }
 | |
| // ====
 | |
| // compileViaYul: also
 | |
| // ----
 | |
| // f() -> 0, 0
 |