[PATCH] Avoid lexer crash with -frewrite-includes

Lubos Lunak l.lunak at centrum.cz
Thu Nov 28 08:05:09 PST 2013


On Thursday 28 of November 2013, Alp Toker wrote:
> #include "rewrite-includes-bom.h"#endif /* expanded by -frewrite-includes
> */
>
> On 27/11/2013 18:24, Lubos Lunak wrote:
> >   As discussed in " [PATCH] PR14795 : -frewrite-includes sometimes
> > results in incorrect line number", the following leads to a crash:
>
> I don't see a crash mentioned in PR14795. Wrong bug?

 That is a reference to the mailing list thread, not to the PR itself.
> Be aware however that with this change, you'll get invalid expansions like:
>
> #include "rewrite-includes-bom.h"#endif /* expanded by -frewrite-includes
> */
>
> Unless this is expected behaviour, you'll need to add special handling
> for end-of-directive in the include rewriter.

 Rather unlikely in practice, but why not, attached.

-- 
 Lubos Lunak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ensure-newline-if-last-line-is-include-without-trail.patch
Type: text/x-diff
Size: 1165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131128/6c992c06/attachment.patch>


More information about the cfe-commits mailing list