From 99b28e7e6b136acd8b294a807550e66f78c07f44 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Thu, 12 Jul 2012 16:34:32 +0000 Subject: [PATCH] Always initialize variable. If opening quote is the last character in comment, we will be using an uninitialized value. There is already a test for that in unittests/AST/CommentLexer.cpp, but it seems like we were lucky with the value that got loaded into the variable so the test passed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160133 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/CommentLexer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h index 1ff793701d..f167934b8a 100644 --- a/include/clang/AST/CommentLexer.h +++ b/include/clang/AST/CommentLexer.h @@ -509,7 +509,7 @@ public: } else Error = true; } - char C; + char C = '\0'; while (!Error && !isEnd()) { C = peek(); WordText.push_back(C); -- 2.40.0