Fix #2593
This commit is contained in:
1 parent
ea20b644cc
commit
6495f2cf98
1 file changed
+4
-1
+4
-1
@@ -4774,7 +4774,10 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod
|
|||||||
|
|
||||||
if (entity == nullptr && selector->kind == Ast_Ident) {
|
if (entity == nullptr && selector->kind == Ast_Ident) {
|
||||||
String field_name = selector->Ident.token.string;
|
String field_name = selector->Ident.token.string;
|
||||||
if (is_type_dynamic_array(type_deref(operand->type))) {
|
Type *t = type_deref(operand->type);
|
||||||
|
if (t == nullptr) {
|
||||||
|
error(operand->expr, "Cannot use a selector expression on 0-value expression");
|
||||||
|
} else if (is_type_dynamic_array(t)) {
|
||||||
init_mem_allocator(c->checker);
|
init_mem_allocator(c->checker);
|
||||||
}
|
}
|
||||||
sel = lookup_field(operand->type, field_name, operand->mode == Addressing_Type);
|
sel = lookup_field(operand->type, field_name, operand->mode == Addressing_Type);
|
||||||
|
|||||||
Reference in new issue
Block a user