mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Fix nullptr entity case
This commit is contained in:
+5
-5
@@ -5908,11 +5908,13 @@ gb_internal bool check_call_arguments_single(CheckerContext *c, Ast *call, Opera
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e == nullptr) {
|
if (e == nullptr) {
|
||||||
GB_ASSERT(proc_type == nullptr);
|
|
||||||
e = entity_of_node(ident);
|
e = entity_of_node(ident);
|
||||||
|
if (e != nullptr) {
|
||||||
proc_type = e->type;
|
proc_type = e->type;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GB_ASSERT(proc_type != nullptr);
|
||||||
proc_type = base_type(proc_type);
|
proc_type = base_type(proc_type);
|
||||||
GB_ASSERT(proc_type->kind == Type_Proc);
|
GB_ASSERT(proc_type->kind == Type_Proc);
|
||||||
|
|
||||||
@@ -5922,13 +5924,11 @@ gb_internal bool check_call_arguments_single(CheckerContext *c, Ast *call, Opera
|
|||||||
}
|
}
|
||||||
|
|
||||||
Entity *entity_to_use = data->gen_entity != nullptr ? data->gen_entity : e;
|
Entity *entity_to_use = data->gen_entity != nullptr ? data->gen_entity : e;
|
||||||
if (!return_on_failure) {
|
if (!return_on_failure && entity_to_use != nullptr) {
|
||||||
add_entity_use(c, ident, entity_to_use);
|
add_entity_use(c, ident, entity_to_use);
|
||||||
if (entity_to_use != nullptr) {
|
|
||||||
update_untyped_expr_type(c, operand->expr, entity_to_use->type, true);
|
update_untyped_expr_type(c, operand->expr, entity_to_use->type, true);
|
||||||
add_type_and_value(c, operand->expr, operand->mode, entity_to_use->type, operand->value);
|
add_type_and_value(c, operand->expr, operand->mode, entity_to_use->type, operand->value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (data->gen_entity != nullptr) {
|
if (data->gen_entity != nullptr) {
|
||||||
Entity *e = data->gen_entity;
|
Entity *e = data->gen_entity;
|
||||||
@@ -6474,7 +6474,7 @@ gb_internal CallArgumentData check_call_arguments(CheckerContext *c, Operand *op
|
|||||||
|
|
||||||
if (!any_failure) {
|
if (!any_failure) {
|
||||||
check_call_arguments_single(c, call, operand,
|
check_call_arguments_single(c, call, operand,
|
||||||
nullptr, nullptr,
|
nullptr, proc_type,
|
||||||
positional_operands, named_operands,
|
positional_operands, named_operands,
|
||||||
CallArgumentErrorMode::ShowErrors,
|
CallArgumentErrorMode::ShowErrors,
|
||||||
&data);
|
&data);
|
||||||
|
|||||||
Reference in New Issue
Block a user