Fix printing error when field name could not be found

This commit is contained in:
gingerBill
2024-04-08 12:06:06 +01:00
parent 0df9c8bffc
commit 114ddc4a10

View File

@@ -4595,7 +4595,8 @@ gb_internal ExactValue get_constant_field_single(CheckerContext *c, ExactValue v
String name = fv->field->Ident.token.string;
Selection sub_sel = lookup_field(node->tav.type, name, false);
defer (array_free(&sub_sel.index));
if (sub_sel.index[0] == index) {
if (sub_sel.index.count > 0 &&
sub_sel.index[0] == index) {
value = fv->value->tav.value;
found = true;
break;