Skip to content

Commit

Permalink
Check if undef is not null in DefineFinder::MacroUndefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kornilova203 committed Jul 18, 2018
1 parent 9ced3ac commit ce84116
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindgen/defines/DefineFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ bool DefineFinder::isFunctionLikeMacro(const clang::Token &token) {
void DefineFinder::MacroUndefined(const clang::Token &macroNameTok,
const clang::MacroDefinition &md,
const clang::MacroDirective *undef) {
if (!undef) {
/* macro was not defined */
return;
}
clang::SourceManager &sm = compiler.getSourceManager();
if (!sm.isInMainFile(undef->getLocation())) {
return;
Expand Down

0 comments on commit ce84116

Please sign in to comment.