diff options
| author | gingerBill <bill@gingerbill.org> | 2025-06-09 17:19:58 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-06-09 17:19:58 +0100 |
| commit | 002b50360c7fd9a5ac62816e634c1bd73277f90d (patch) | |
| tree | 3437f8efab2ee300bdf9fffe17aead4365e21336 /src/checker.cpp | |
| parent | 2ffd6be20a50f1f9146af3c12c5adf8cf3d2e095 (diff) | |
| parent | 4a675395c5c65199046b5aefbe8528f5969d633e (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 9bc02cd87..4ebabe004 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -2054,7 +2054,7 @@ gb_internal void add_type_info_type(CheckerContext *c, Type *t) { } gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) { - if (t == nullptr) { + if (t == nullptr || c == nullptr) { return; } @@ -3776,6 +3776,12 @@ gb_internal DECL_ATTRIBUTE_PROC(proc_decl_attribute) { } ac->no_sanitize_address = true; return true; + } else if (name == "no_sanitize_memory") { + if (value != nullptr) { + error(value, "'%.*s' expects no parameter", LIT(name)); + } + ac->no_sanitize_memory = true; + return true; } return false; } @@ -6672,7 +6678,7 @@ gb_internal void check_sort_init_and_fini_procedures(Checker *c) { gb_internal void add_type_info_for_type_definitions(Checker *c) { for_array(i, c->info.definitions) { Entity *e = c->info.definitions[i]; - if (e->kind == Entity_TypeName && e->type != nullptr) { + if (e->kind == Entity_TypeName && e->type != nullptr && is_type_typed(e->type)) { i64 align = type_align_of(e->type); if (align > 0 && ptr_set_exists(&c->info.minimum_dependency_set, e)) { add_type_info_type(&c->builtin_ctx, e->type); @@ -6794,7 +6800,7 @@ gb_internal void check_parsed_files(Checker *c) { // NOTE(bill): Check for illegal cyclic type declarations for_array(i, c->info.definitions) { Entity *e = c->info.definitions[i]; - if (e->kind == Entity_TypeName && e->type != nullptr) { + if (e->kind == Entity_TypeName && e->type != nullptr && is_type_typed(e->type)) { (void)type_align_of(e->type); } else if (e->kind == Entity_Procedure) { DeclInfo *decl = e->decl_info; |