Merge pull request #57091 from Chaosus/fix_unused_localvar_warnings

This commit is contained in:
Yuri Roubinsky 2022-01-23 21:25:37 +03:00 committed by GitHub
commit dc5fbfdbdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -5208,9 +5208,15 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
#ifdef DEBUG_ENABLED
if (check_warnings) {
StringName func_name;
BlockNode *b = p_block;
if (p_block && p_block->parent_function) {
func_name = p_block->parent_function->name;
while (b) {
if (b->parent_function) {
func_name = b->parent_function->name;
break;
} else {
b = b->parent_block;
}
}
_parse_used_identifier(identifier, ident_type, func_name);