]> granicus.if.org Git - clang/commit
Fix rdar://6562329, a static analyzer crash Ted noticed on
authorChris Lattner <sabre@nondot.org>
Fri, 13 Feb 2009 19:33:24 +0000 (19:33 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Feb 2009 19:33:24 +0000 (19:33 +0000)
commit05db4278ecd193edcff63fb8c54818226fceaad2
treeabfc44def41fa2981f5aec2c188a3237b56bb5a6
parent59c5b118dfbcbc22c65ae42b8f5ef5979ec802ee
Fix rdar://6562329, a static analyzer crash Ted noticed on
wine sources.  This was happening because HighlightMacros was
calling EnterMainFile multiple times on the same preprocessor
object and getting an assert due to the new #line stuff (the
file in question was bison output with #line directives).

The fix for this is to not reenter the file.  Instead,
relex the tokens in raw mode, swizzle them a bit and repreprocess
the token stream.  An added bonus of this is that rewrite macros
will now hilight the macro definition as well as its uses.  Woo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64480 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Lex/Preprocessor.cpp
lib/Rewrite/HTMLRewrite.cpp
test/Misc/emit-html.c [new file with mode: 0644]