Browse Source

Do not try to handle preprocessed entities for invalid locations.

pull/22/merge
triton 12 years ago
parent
commit
7bd56c9b98
  1. 11
      src/Parser/Parser.cpp

11
src/Parser/Parser.cpp

@ -1752,6 +1752,17 @@ void Parser::HandlePreprocessedEntities(CppSharp::AST::Declaration^ Decl, @@ -1752,6 +1752,17 @@ void Parser::HandlePreprocessedEntities(CppSharp::AST::Declaration^ Decl,
clang::SourceRange sourceRange,
CppSharp::AST::MacroLocation macroLocation)
{
if (sourceRange.isInvalid()) return;
auto& SourceMgr = C->getSourceManager();
auto isBefore = SourceMgr.isBeforeInTranslationUnit(sourceRange.getEnd(),
sourceRange.getBegin());
if (isBefore) return;
assert(!SourceMgr.isBeforeInTranslationUnit(sourceRange.getEnd(),
sourceRange.getBegin()));
using namespace clang;
auto PPRecord = C->getPreprocessor().getPreprocessingRecord();

Loading…
Cancel
Save