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