mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix min dep type info problem caused by const ref of map_set
This commit is contained in:
@@ -1576,5 +1576,34 @@ gb_internal bool check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *de
|
|||||||
|
|
||||||
check_scope_usage(ctx->checker, ctx->scope);
|
check_scope_usage(ctx->checker, ctx->scope);
|
||||||
|
|
||||||
|
// if (decl->parent) {
|
||||||
|
// Scope *ps = decl->parent->scope;
|
||||||
|
// if (ps->flags & (ScopeFlag_File & ScopeFlag_Pkg & ScopeFlag_Global)) {
|
||||||
|
// return true;
|
||||||
|
// } else {
|
||||||
|
// // NOTE(bill): Add the dependencies from the procedure literal (lambda)
|
||||||
|
// // But only at the procedure level
|
||||||
|
// rw_mutex_shared_lock(&decl->deps_mutex);
|
||||||
|
// rw_mutex_lock(&decl->parent->deps_mutex);
|
||||||
|
|
||||||
|
// for (Entity *e : decl->deps) {
|
||||||
|
// ptr_set_add(&decl->parent->deps, e);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// rw_mutex_unlock(&decl->parent->deps_mutex);
|
||||||
|
// rw_mutex_shared_unlock(&decl->deps_mutex);
|
||||||
|
|
||||||
|
// rw_mutex_shared_lock(&decl->type_info_deps_mutex);
|
||||||
|
// rw_mutex_lock(&decl->parent->type_info_deps_mutex);
|
||||||
|
|
||||||
|
// for (Type *t : decl->type_info_deps) {
|
||||||
|
// ptr_set_add(&decl->parent->type_info_deps, t);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// rw_mutex_unlock(&decl->parent->type_info_deps_mutex);
|
||||||
|
// rw_mutex_shared_unlock(&decl->type_info_deps_mutex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -2030,7 +2030,10 @@ gb_internal void add_min_dep_type_info(Checker *c, Type *t) {
|
|||||||
// Type already exists;
|
// Type already exists;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
map_set(set, ti_index, set->entries.count);
|
// IMPORTANT NOTE(bill): this must be copied as `map_set` takes a const ref
|
||||||
|
// and effectively assigns the `+1` of the value
|
||||||
|
isize const count = set->entries.count;
|
||||||
|
map_set(set, ti_index, count);
|
||||||
|
|
||||||
// Add nested types
|
// Add nested types
|
||||||
if (t->kind == Type_Named) {
|
if (t->kind == Type_Named) {
|
||||||
|
|||||||
Reference in New Issue
Block a user