aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/check_decl.cpp2
-rw-r--r--src/llvm_backend.cpp8
-rw-r--r--src/parser.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 218dce2ee..f008317ad 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -359,7 +359,7 @@ void override_entity_in_scope(Entity *original_entity, Entity *new_entity) {
}
if (original_entity->identifier != nullptr &&
original_entity->identifier->kind == Ast_Ident) {
- original_entity->identifier->Ident.entity = new_entity;
+ original_entity->identifier->Ident.entity = nullptr;
}
original_entity->flags |= EntityFlag_Overridden;
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 0fd778b9c..758f8e5d1 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -3544,7 +3544,9 @@ void lb_build_constant_value_decl(lbProcedure *p, AstValueDecl *vd) {
Ast *ident = vd->names[i];
GB_ASSERT(ident->kind == Ast_Ident);
Entity *e = entity_of_node(ident);
- GB_ASSERT(e != nullptr);
+ if (e == nullptr) {
+ continue;
+ }
if (e->kind != Entity_TypeName) {
continue;
}
@@ -3573,7 +3575,9 @@ void lb_build_constant_value_decl(lbProcedure *p, AstValueDecl *vd) {
Ast *ident = vd->names[i];
GB_ASSERT(ident->kind == Ast_Ident);
Entity *e = entity_of_node(ident);
- GB_ASSERT(e != nullptr);
+ if (e == nullptr) {
+ continue;
+ }
if (e->kind != Entity_Procedure) {
continue;
}
diff --git a/src/parser.cpp b/src/parser.cpp
index aff7c6bc7..c81827aa3 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1502,6 +1502,10 @@ bool is_semicolon_optional_for_node(AstFile *f, Ast *s) {
return false;
}
+ if (build_context.insert_semicolon) {
+ return true;
+ }
+
switch (s->kind) {
case Ast_EmptyStmt:
case Ast_BlockStmt: