mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			530 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			530 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| {
 | |
|   function f() -> x { x := g() }
 | |
|   function g() -> x {
 | |
|     x := add(x, 1)
 | |
|     sstore(0x00, 0x00)
 | |
|   }
 | |
| 
 | |
|   let b := 1
 | |
|   for { let a := 1 } iszero(eq(a, 10)) { a := add(a, 1) } {
 | |
|     let q := sload(g())
 | |
|   }
 | |
| }
 | |
| // ----
 | |
| // step: loopInvariantCodeMotion
 | |
| //
 | |
| // {
 | |
| //     let b := 1
 | |
| //     let a := 1
 | |
| //     for { } iszero(eq(a, 10)) { a := add(a, 1) }
 | |
| //     { let q := sload(g()) }
 | |
| //     function f() -> x
 | |
| //     { x := g() }
 | |
| //     function g() -> x_1
 | |
| //     {
 | |
| //         x_1 := add(x_1, 1)
 | |
| //         sstore(0x00, 0x00)
 | |
| //     }
 | |
| // }
 |