mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Extra check for field being nullptr
This commit is contained in:
+6
-4
@@ -19,10 +19,12 @@ gb_internal void populate_using_array_index(CheckerContext *ctx, Ast *node, AstF
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Token tok = make_token_ident(name);
|
Token tok = make_token_ident(name);
|
||||||
if (field->names.count > 0) {
|
if (field) {
|
||||||
tok.pos = ast_token(field->names[0]).pos;
|
if (field->names.count > 0) {
|
||||||
} else {
|
tok.pos = ast_token(field->names[0]).pos;
|
||||||
tok.pos = ast_token(field->type).pos;
|
} else {
|
||||||
|
tok.pos = ast_token(field->type).pos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Entity *f = alloc_entity_array_elem(nullptr, tok, t->Array.elem, idx);
|
Entity *f = alloc_entity_array_elem(nullptr, tok, t->Array.elem, idx);
|
||||||
add_entity(ctx, ctx->scope, nullptr, f);
|
add_entity(ctx, ctx->scope, nullptr, f);
|
||||||
|
|||||||
Reference in New Issue
Block a user