mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 19:30:06 +00:00
Fix #5107
Fixes #5107 by checking whether `result_count` is non-zero before indexing `type->Proc.results->Tuple.variables`.
This commit is contained in:
+1
-1
@@ -8143,7 +8143,7 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
|
|||||||
type = pt;
|
type = pt;
|
||||||
}
|
}
|
||||||
type = base_type(type);
|
type = base_type(type);
|
||||||
if (type->kind == Type_Proc && type->Proc.optional_ok) {
|
if (type->kind == Type_Proc && type->Proc.optional_ok && type->Proc.result_count > 0) {
|
||||||
operand->mode = Addressing_OptionalOk;
|
operand->mode = Addressing_OptionalOk;
|
||||||
operand->type = type->Proc.results->Tuple.variables[0]->type;
|
operand->type = type->Proc.results->Tuple.variables[0]->type;
|
||||||
if (operand->expr != nullptr && operand->expr->kind == Ast_CallExpr) {
|
if (operand->expr != nullptr && operand->expr->kind == Ast_CallExpr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user