Add some basic escape analysis errors for return &x

This commit is contained in:
gingerBill
2024-03-23 14:58:10 +00:00
parent eb61cf6043
commit 624b870f28
3 changed files with 68 additions and 51 deletions
+1
View File
@@ -4050,6 +4050,7 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) {
Entity *e = alloc_entity_variable(c->scope, name->Ident.token, nullptr);
e->identifier = name;
e->file = c->file;
e->Variable.is_global = true;
if (entity_visibility_kind != EntityVisiblity_Public) {
e->flags |= EntityFlag_NotExported;