cgo: be able to deal with nil files

I'm not sure where they come from but they lead to a crash, so turn them
into token.NoPos.
Этот коммит содержится в:
Ayke van Laethem 2019-04-28 00:07:28 +02:00 коммит произвёл Ron Evans
родитель 9cad8bd0c8
коммит 78a26fec13

Просмотреть файл

@ -244,7 +244,7 @@ func (info *fileInfo) getCursorPosition(cursor C.GoCXCursor) token.Pos {
var column C.unsigned
var offset C.unsigned
C.clang_getExpansionLocation(location, &file, &line, &column, &offset)
if line == 0 {
if line == 0 || file == nil {
// Invalid token.
return token.NoPos
}