Analyzer does not crash

This commit is contained in:
Sasha Koshka 2024-02-14 13:40:26 -05:00
parent 04a94a2dc9
commit 953e9336db
1 changed files with 8 additions and 6 deletions

View File

@ -70,17 +70,19 @@ func (this *Tree) analyzeTypeInternal (
// if we are analyzing a typedef, we will need to update incomplete type
// information as we go in order for recursive type definitions to work
rootKey := Key {
Unit: this.unit,
Name: root.Name,
rootKey := func () Key {
return Key {
Unit: this.unit,
Name: root.Name,
}
}
updateIncompleteInfo := func () {
if root != nil { this.incompleteTypes[rootKey] = root }
if root != nil { this.incompleteTypes[rootKey()] = root }
}
updatePseudoCompleteInfo := func () {
if root != nil { this.Types[rootKey] = root }
if root != nil { this.Types[rootKey()] = root }
}
if root != nil { defer delete(this.incompleteTypes, rootKey) }
if root != nil { defer delete(this.incompleteTypes, rootKey()) }
// ---------
switch ty.(type) {