Browse Source

Fixed segmentation fault if file was empty.

merge-requests/37/head
eidheim 11 years ago
parent
commit
8294a98905
  1. 2
      src/SourceLocation.cc

2
src/SourceLocation.cc

@ -52,7 +52,7 @@ get_location_info(std::string* path,
unsigned *offset) { unsigned *offset) {
CXFile file; CXFile file;
clang_getExpansionLocation(location_, &file, line, column, offset); clang_getExpansionLocation(location_, &file, line, column, offset);
if (path != NULL) { if (path != NULL && file!=NULL) {
path->operator=(((clang_getCString((clang_getFileName(file)))))); path->operator=(((clang_getCString((clang_getFileName(file))))));
} }
} }

Loading…
Cancel
Save