Skip to content

Commit 27bd72c

Browse files
committed
Fix constant indexing within a call that doesn't exist
1 parent 4157529 commit 27bd72c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/check_expr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5192,6 +5192,11 @@ gb_internal ExactValue get_constant_field_single(CheckerContext *c, ExactValue v
51925192
}
51935193
} else {
51945194
TypeAndValue index_tav = fv->field->tav;
5195+
if (index_tav.mode != Addressing_Constant) {
5196+
if (success_) *success_ = false;
5197+
if (finish_) *finish_ = true;
5198+
return empty_exact_value;
5199+
}
51955200
GB_ASSERT(index_tav.mode == Addressing_Constant);
51965201
ExactValue index_value = index_tav.value;
51975202
if (is_type_enumerated_array(node->tav.type)) {

0 commit comments

Comments
 (0)