Analyzer does not crash
This commit is contained in:
parent
04a94a2dc9
commit
953e9336db
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue