mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add extra check
This commit is contained in:
@@ -1949,6 +1949,7 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
|
|||||||
entity = alloc_entity_variable(ctx->scope, token, type, EntityState_Resolved);
|
entity = alloc_entity_variable(ctx->scope, token, type, EntityState_Resolved);
|
||||||
entity->flags |= EntityFlag_ForValue;
|
entity->flags |= EntityFlag_ForValue;
|
||||||
entity->flags |= EntityFlag_Value;
|
entity->flags |= EntityFlag_Value;
|
||||||
|
entity->identifier = name;
|
||||||
if (i == addressable_index && use_by_reference_for_value) {
|
if (i == addressable_index && use_by_reference_for_value) {
|
||||||
entity->flags &= ~EntityFlag_Value;
|
entity->flags &= ~EntityFlag_Value;
|
||||||
}
|
}
|
||||||
@@ -1973,6 +1974,7 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
|
|||||||
|
|
||||||
if (entity == nullptr) {
|
if (entity == nullptr) {
|
||||||
entity = alloc_entity_dummy_variable(builtin_pkg->scope, ast_token(name));
|
entity = alloc_entity_dummy_variable(builtin_pkg->scope, ast_token(name));
|
||||||
|
entity->identifier = name; // might not be an identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
array_add(&entities, entity);
|
array_add(&entities, entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user