r200381 - Fix crash on unmatched #endif's.
Alp Toker
alp at nuanti.com
Wed Jan 29 09:13:24 PST 2014
On 29/01/2014 16:47, David Blaikie wrote:
>
>
>
> On Wed, Jan 29, 2014 at 12:49 AM, Manuel Klimek <klimek at google.com
> <mailto:klimek at google.com>> wrote:
>
> Author: klimek
> Date: Wed Jan 29 02:49:02 2014
> New Revision: 200381
>
> URL: http://llvm.org/viewvc/llvm-project?rev=200381&view=rev
> Log:
> Fix crash on unmatched #endif's.
>
> The following snippet would crash:
> #endif
> #if A
>
>
> Any reason this wasn't contributed as a test case?
>
>
> ==============================================================================
> --- cfe/trunk/unittests/Format/FormatTest.cpp (original)
> +++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Jan 29 02:49:02 2014
> @@ -2427,6 +2427,11 @@ TEST_F(FormatTest, LayoutStatementsAroun
> "#endif");
> }
>
> +TEST_F(FormatTest, GraciouslyHandleIncorrectPreprocessorConditions) {
> + verifyFormat("#endif\n"
> + "#if B");
> +}
> +
>
Like this?
Alp.
--
http://www.nuanti.com
the browser experts
More information about the cfe-commits
mailing list