diff options
author | Ayke van Laethem <[email protected]> | 2018-09-29 00:11:05 +0200 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-09-29 00:11:05 +0200 |
commit | 318567f3989a4b90d85a87b1fd67656a2413389d (patch) | |
tree | d4a132fda9ddc42e3023f4586a1c014298ee9524 /ir | |
parent | 8d170d3bd291f110a9bc72cd462d6c86557897e0 (diff) | |
download | tinygo-318567f3989a4b90d85a87b1fd67656a2413389d.tar.gz tinygo-318567f3989a4b90d85a87b1fd67656a2413389d.zip |
ir: fix nil pointer dereference in IsVolatile
Diffstat (limited to 'ir')
-rw-r--r-- | ir/ir.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 { |