fix(parser): reject an array-of-tables header extending a frozen inline table

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-17 23:04:49 +02:00
parent d2fc31d260
commit 696f117c22
3 changed files with 13 additions and 0 deletions
+5
View File
@@ -171,7 +171,12 @@ func (p *parser) tableAt(key []string) (map[string]any, error) {
func (p *parser) appendArrayTable(key []string) (map[string]any, error) {
parent := p.root
path := make([]string, 0, len(key))
for _, k := range key[:len(key)-1] {
path = append(path, k)
if p.frozen[pathKey(path)] {
return nil, p.errf("cannot extend inline table %q", strings.Join(path, "."))
}
existing, ok := parent[k]
if !ok {
next := map[string]any{}