aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-08-24 12:26:41 +0100
committergingerBill <bill@gingerbill.org>2024-08-24 12:26:41 +0100
commitca4d91a8a33c2209ef9f6708fb5effc278a2b9f5 (patch)
tree59a6487d2309d0d642021a07ddbd7729611f209d /src
parent65543b993ff3795aae74c0d362043aa6a3198deb (diff)
Fix #4079
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index a878911d9..7ac09ac56 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4662,7 +4662,8 @@ gb_internal bool check_index_value(CheckerContext *c, Type *main_type, bool open
check_expr_with_type_hint(c, &operand, index_value, type_hint);
if (operand.mode == Addressing_Invalid) {
if (value) *value = 0;
- return false;
+ // NOTE(bill): return true here to propagate the errors better
+ return true;
}
Type *index_type = t_int;
@@ -4883,7 +4884,7 @@ gb_internal ExactValue get_constant_field_single(CheckerContext *c, ExactValue v
TypeAndValue tav = fv->value->tav;
if (success_) *success_ = true;
if (finish_) *finish_ = false;
- return tav.value;;
+ return tav.value;
}
}
@@ -4958,7 +4959,6 @@ gb_internal ExactValue get_constant_field(CheckerContext *c, Operand const *oper
return value;
}
}
-
if (success_) *success_ = true;
return value;
} else if (value.kind == ExactValue_Quaternion) {
@@ -10566,7 +10566,8 @@ gb_internal ExprKind check_index_expr(CheckerContext *c, Operand *o, Ast *node,
o->expr = node;
return kind;
} else if (ok && !is_type_matrix(t)) {
- ExactValue value = type_and_value_of_expr(ie->expr).value;
+ TypeAndValue tav = type_and_value_of_expr(ie->expr);
+ ExactValue value = tav.value;
o->mode = Addressing_Constant;
bool success = false;
bool finish = false;