Merge pull request #71329 from vnen/gdscript-fix-enum-value-resolution

GDScript: Fix infinite recursion in resolution of enum values
This commit is contained in:
Rémi Verschelde 2023-01-13 18:02:58 +01:00
commit ef01b49227
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -889,11 +889,11 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
resolve_function_signature(member.function, p_source);
break;
case GDScriptParser::ClassNode::Member::ENUM_VALUE: {
member.enum_value.identifier->set_datatype(resolving_datatype);
if (member.enum_value.custom_value) {
check_class_member_name_conflict(p_class, member.enum_value.identifier->name, member.enum_value.custom_value);
member.enum_value.identifier->set_datatype(resolving_datatype);
const GDScriptParser::EnumNode *prev_enum = current_enum;
current_enum = member.enum_value.parent_enum;
reduce_expression(member.enum_value.custom_value);