mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 19:23:25 +00:00
ir: fix nil pointer dereference in IsVolatile
This commit is contained in:
@@ -425,6 +425,9 @@ func (p *Program) IsVolatile(t types.Type) bool {
|
|||||||
if t, ok := t.(*types.Named); !ok {
|
if t, ok := t.(*types.Named); !ok {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
|
if t.Obj().Pkg() == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
id := t.Obj().Pkg().Path() + "." + t.Obj().Name()
|
id := t.Obj().Pkg().Path() + "." + t.Obj().Name()
|
||||||
doc := p.comments[id]
|
doc := p.comments[id]
|
||||||
if doc == nil {
|
if doc == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user