Bug in Preprocessor::HandlePragmaDirective ?

In Pragma.cpp, line 96:

if (CurPPLexer->ParsingPreprocessorDirective <http://clang.llvm.org/doxygen/classclang_1_1PreprocessorLexer.html#6388ce47d19b9f7d0c703c643ab903a5&gt;\)

Is this correct? We got a segmentation fault [1] there (CurPPLexer is null) in our application. I could reproduce it with a small sample program [2] and even smaller input file [3] using pragma namespaces.

We fixed the immediate problem locally by changing the line above to

if (CurPPLexer&& CurPPLexer->ParsingPreprocessorDirective <http://clang.llvm.org/doxygen/classclang_1_1PreprocessorLexer.html#6388ce47d19b9f7d0c703c643ab903a5&gt;\)

but I'm not quite sure that this is the correct way of doing it.

[1] http://pastebin.com/d48a6b613
[2] http://pastebin.com/m20e46def
[3] http://pastebin.com/d1584397c

Hi Peter,

I'm not certain if anyone responded to you. If nobody hasn't, can you please file a bug report? That way we don't lose track of it. I plan on looking into this shortly.


Yep, that's the right fix, I committed it with r73689, thanks!