Skip to content

Commit ccb500b

Browse files
Fixing the funclit pointer problem
1 parent ae7afcd commit ccb500b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

compiler/package.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,22 @@ func PrepareAllSources(root *sources.Sources, allSources map[string]*sources.Sou
156156
return err
157157
}
158158

159+
for _, srcs := range allSources {
160+
if srcs.TypeInfo == nil {
161+
fmt.Printf("PrepareAllSources: typeInfo is nil for %s\n", srcs.ImportPath)
162+
if err := srcs.Prepare(importer, sizes32, tContext); err != nil {
163+
return err
164+
}
165+
}
166+
}
167+
159168
// Propagate the analysis information to all packages.
160169
allInfo := make([]*analysis.Info, 0, len(allSources))
161170
for _, src := range allSources {
171+
typeInfo := src.TypeInfo
172+
if typeInfo == nil {
173+
panic(fmt.Errorf("PrepareAllSources: typeInfo is nil for %s", src.ImportPath))
174+
}
162175
allInfo = append(allInfo, src.TypeInfo)
163176
}
164177
analysis.PropagateAnalysis(allInfo)

0 commit comments

Comments
 (0)