mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			621 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			621 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-3.0
 | |
| pragma solidity *;
 | |
| 
 | |
| contract C {
 | |
|     function f() pure public {
 | |
|         assembly ("memory-safe") {
 | |
|             function f() -> x {
 | |
|                 x := mload(0)
 | |
|             }
 | |
| 
 | |
|             // Presence of msize disables all Yul optimizations, including the minimal steps or
 | |
|             // stack optimization that would normally be performed even with the optimizer nominally disabled.
 | |
|             // This block should remain untouched when passed through the optimizer.
 | |
|             pop(msize())
 | |
| 
 | |
|             let x := 0
 | |
|             let y := x
 | |
|             mstore(0, f())
 | |
|         }
 | |
|     }
 | |
| }
 |