From 8294a9890522db4110de414a98e0173e352601c2 Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 1 Jul 2015 16:12:11 +0200 Subject: [PATCH] Fixed segmentation fault if file was empty. --- src/SourceLocation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SourceLocation.cc b/src/SourceLocation.cc index 36564df..c68d32f 100644 --- a/src/SourceLocation.cc +++ b/src/SourceLocation.cc @@ -52,7 +52,7 @@ get_location_info(std::string* path, unsigned *offset) { CXFile file; clang_getExpansionLocation(location_, &file, line, column, offset); - if (path != NULL) { + if (path != NULL && file!=NULL) { path->operator=(((clang_getCString((clang_getFileName(file)))))); } }