瀏覽代碼

Fix crash when a variable declaration must be an identifier

gingerBill 2 年之前
父節點
當前提交
570b127869
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/checker.cpp

+ 3 - 4
src/checker.cpp

@@ -1478,10 +1478,9 @@ gb_internal void add_type_and_value(CheckerContext *ctx, Ast *expr, AddressingMo
 
 gb_internal void add_entity_definition(CheckerInfo *i, Ast *identifier, Entity *entity) {
 	GB_ASSERT(identifier != nullptr);
-	GB_ASSERT(identifier->kind == Ast_Ident);
-	// if (is_blank_ident(identifier)) {
-		// return;
-	// }
+	if (identifier->kind != Ast_Ident) {
+		return;
+	}
 	if (identifier->Ident.entity != nullptr) {
 		// NOTE(bill): Identifier has already been handled
 		return;