mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			500 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			500 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract C {
 | 
						|
    struct S {
 | 
						|
        uint64 y;
 | 
						|
        uint64 z;
 | 
						|
    }
 | 
						|
    S s;
 | 
						|
    function f() public returns (uint256 ret) {
 | 
						|
        assembly {
 | 
						|
            // 2 ** 150 - 1
 | 
						|
            sstore(s.slot, 1427247692705959881058285969449495136382746623)
 | 
						|
        }
 | 
						|
        s.y = 1; s.z = 2;
 | 
						|
        delete s;
 | 
						|
        assert(s.y == 0);
 | 
						|
        assert(s.z == 0);
 | 
						|
        assembly {
 | 
						|
            ret := sload(s.slot)
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileToEwasm: also
 | 
						|
// compileViaYul: true
 | 
						|
// ----
 | 
						|
// f() -> 0
 |