mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			403 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			403 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
|     struct S {
 | |
|         uint8[] m;
 | |
|     }
 | |
|     function f() public pure returns (bool correct) {
 | |
|         S memory s;
 | |
|         s.m = new uint8[](1);
 | |
|         assembly {
 | |
|             mstore(add(s, 64), 257)
 | |
|         }
 | |
|         uint8 x = s.m[0];
 | |
|         uint r;
 | |
|         assembly {
 | |
|             r := x
 | |
|         }
 | |
|         correct = r == 0x01;
 | |
|     }
 | |
| }
 | |
| // ====
 | |
| // compileViaYul: true
 | |
| // ----
 | |
| // f() -> true
 |