Jelajahi Sumber

Make 'is_attribute' false during parse error to prevent crash

SaracenOne 3 tahun lalu
induk
melakukan
ae0026bc7b
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      modules/gdscript/gdscript_parser.cpp

+ 2 - 1
modules/gdscript/gdscript_parser.cpp

@@ -2692,12 +2692,13 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_attribute(ExpressionNode *
 		}
 	}
 
-	attribute->is_attribute = true;
 	attribute->base = p_previous_operand;
 
 	if (!consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier after "." for attribute access.)")) {
 		return attribute;
 	}
+
+	attribute->is_attribute = true;
 	attribute->attribute = parse_identifier();
 
 	return attribute;