fix(parser): reject an array-of-tables header extending a frozen inline table
Assisted-by: GLM 5.3
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user