mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 23:21:15 +00:00 
			
		
		
		
	Merge pull request #43226 from mateosss/unreachable-prop-crash
Fix crash due to unreachable code in properties
This commit is contained in:
		
						commit
						cf7a6be1db
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -1421,7 +1421,11 @@ GDScriptParser::Node *GDScriptParser::parse_statement() {
 | 
				
			||||||
#ifdef DEBUG_ENABLED
 | 
					#ifdef DEBUG_ENABLED
 | 
				
			||||||
	if (unreachable) {
 | 
						if (unreachable) {
 | 
				
			||||||
		current_suite->has_unreachable_code = true;
 | 
							current_suite->has_unreachable_code = true;
 | 
				
			||||||
 | 
							if (current_function) {
 | 
				
			||||||
			push_warning(result, GDScriptWarning::UNREACHABLE_CODE, current_function->identifier->name);
 | 
								push_warning(result, GDScriptWarning::UNREACHABLE_CODE, current_function->identifier->name);
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								// TODO: Properties setters and getters with unreachable code are not being warned
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue