From 62c78f547471aaccf639f6ec32bf3e633bc4effd Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 6 May 2015 08:58:57 +0000 Subject: clang-format: Prevent assertion discovered by fuzzer. llvm-svn: 236578 --- clang/unittests/Format/FormatTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 762f92c042c..31befad6783 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1056,6 +1056,8 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { verifyNoCrash("/\\\n/"); verifyNoCrash("/\\\n* */"); + // The 0-character somehow makes the lexer return a proper comment. + verifyNoCrash(StringRef("/*\\\0\n/", 6)); } TEST_F(FormatTest, KeepsParameterWithTrailingCommentsOnTheirOwnLine) { -- cgit v1.2.3