[PATCH] Avoid lexer crash with -frewrite-includes
l.lunak at centrum.cz
Wed Nov 27 10:24:50 PST 2013
As discussed in " [PATCH] PR14795 : -frewrite-includes sometimes results in
incorrect line number", the following leads to a crash:
$ echo -ne '#if 0\n#endif' >a.cpp
$ clang++ -frewrite-includes -E a.cpp
The attached patch adds a trivial fix avoiding the problem. I'm not quite
sure why the problem happens, but presumably it has something to do with the
lexing not being driven by the preprocessor instance (so maybe that one gets
deleted when reaching EOF?).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1319 bytes
Desc: not available
More information about the cfe-commits