diff --git a/loader/libclang.go b/loader/libclang.go index 4292ed88..1d6a9ee8 100644 --- a/loader/libclang.go +++ b/loader/libclang.go @@ -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 }