Merge pull request #6928 from bergperri/fix-field-names-report-error

Fix compiler segmentation fault when field names start with '.'
This commit is contained in:
Jeroen van Rijn
2026-07-02 03:41:14 +02:00
committed by GitHub

View File

@@ -10226,7 +10226,7 @@ gb_internal void check_compound_literal_field_values(CheckerContext *c, Slice<As
Ast *ident = fv->field;
if (ident->kind == Ast_ImplicitSelectorExpr) {
gbString expr_str = expr_to_string(ident);
error(ident, "Field names do not start with a '.', remove the '.' in %.*s", expr_str, LIT(assignment_str));
error(ident, "Field names do not start with a '.', remove the '.' from '%s' in %.*s", expr_str, LIT(assignment_str));
gb_string_free(expr_str);
ident = ident->ImplicitSelectorExpr.selector;