ir: fix nil pointer dereference in IsVolatile

This commit is contained in:
Ayke van Laethem
2018-09-29 00:11:05 +02:00
parent 8d170d3bd2
commit 318567f398
+3
View File
@@ -425,6 +425,9 @@ func (p *Program) IsVolatile(t types.Type) bool {
if t, ok := t.(*types.Named); !ok {
return false
} else {
if t.Obj().Pkg() == nil {
return false
}
id := t.Obj().Pkg().Path() + "." + t.Obj().Name()
doc := p.comments[id]
if doc == nil {