diff options
| author | Laytan <laytanlaats@hotmail.com> | 2025-04-30 19:54:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-30 19:54:48 +0200 |
| commit | c74f777b1ba94bf5e3cec20dd41f4ca753d4aba1 (patch) | |
| tree | 0b756675ea4df160276f21377c3a8e8e87caeb7a /src/check_expr.cpp | |
| parent | e64bcc77091ff9215b7775d2ee2245a92a02c2a7 (diff) | |
| parent | 9fb938244920b1a9d9a085ceaf651219baddc854 (diff) | |
Merge pull request #5097 from laytan/fix-pointer-alias-type-check
fixes assigning null as a type if it's an alias but the base type is null
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 5185876e6..69f6bb855 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1854,7 +1854,10 @@ gb_internal Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *nam o->type = t_invalid; } if (o->type != nullptr && o->type->kind == Type_Named && o->type->Named.type_name->TypeName.is_type_alias) { - o->type = base_type(o->type); + Type *bt = base_type(o->type); + if (bt != nullptr) { + o->type = bt; + } } break; |