Cast parameter of '!' to _Bool
This commit is contained in:
		
							parent
							
								
									2d9b5e0bb8
								
							
						
					
					
						commit
						1b599ea7f8
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		
							
								
								
									
										7
									
								
								tcc.c
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								tcc.c
									
										
									
									
									
								
							| 
						 | 
					@ -7516,9 +7516,12 @@ static void unary(void)
 | 
				
			||||||
    case '!':
 | 
					    case '!':
 | 
				
			||||||
        next();
 | 
					        next();
 | 
				
			||||||
        unary();
 | 
					        unary();
 | 
				
			||||||
        if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)
 | 
					        if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
 | 
				
			||||||
 | 
					            CType boolean;
 | 
				
			||||||
 | 
					            boolean.t = VT_BOOL;
 | 
				
			||||||
 | 
					            gen_cast(&boolean);
 | 
				
			||||||
            vtop->c.i = !vtop->c.i;
 | 
					            vtop->c.i = !vtop->c.i;
 | 
				
			||||||
        else if ((vtop->r & VT_VALMASK) == VT_CMP)
 | 
					        } else if ((vtop->r & VT_VALMASK) == VT_CMP)
 | 
				
			||||||
            vtop->c.i = vtop->c.i ^ 1;
 | 
					            vtop->c.i = vtop->c.i ^ 1;
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            save_regs(1);
 | 
					            save_regs(1);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue