diff options
| author | gingerBill <bill@gingerbill.org> | 2021-07-10 11:46:22 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-07-10 11:46:22 +0100 |
| commit | 13c3c5be95b70c2f8820fb2219221b627d06643a (patch) | |
| tree | 4658fe004d1bb87d5f4a2d9b348975dcd46cfa33 /src/check_expr.cpp | |
| parent | 3afec0bcbe630d707e97fb12474b44eed42a5b87 (diff) | |
Fix #1028
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index be9b311d1..4e1b69d20 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -5511,7 +5511,7 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper return err; } - while (ordered_operands.count >= 0) { + while (ordered_operands.count > 0) { if (ordered_operands[ordered_operands.count-1].expr != nullptr) { break; } @@ -5560,8 +5560,9 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper } } + isize oo_count = gb_min(param_count, ordered_operands.count); i64 score = 0; - for (isize i = 0; i < param_count; i++) { + for (isize i = 0; i < oo_count; i++) { Entity *e = tuple->variables[i]; Operand *o = &ordered_operands[i]; if (o->mode == Addressing_Invalid) { |