Skip to content

Commit

Permalink
Fix constant aliasing for debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Apr 26, 2021
1 parent 6667b78 commit 04535b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/check_decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 6 additions & 2 deletions src/llvm_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 04535b2

Please sign in to comment.