Skip to content

Commit ce84116

Browse files
committed
Check if undef is not null in DefineFinder::MacroUndefined
1 parent 9ced3ac commit ce84116

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bindgen/defines/DefineFinder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ bool DefineFinder::isFunctionLikeMacro(const clang::Token &token) {
103103
void DefineFinder::MacroUndefined(const clang::Token &macroNameTok,
104104
const clang::MacroDefinition &md,
105105
const clang::MacroDirective *undef) {
106+
if (!undef) {
107+
/* macro was not defined */
108+
return;
109+
}
106110
clang::SourceManager &sm = compiler.getSourceManager();
107111
if (!sm.isInMainFile(undef->getLocation())) {
108112
return;

0 commit comments

Comments
 (0)