From 220b6369d7717bfe6894b46cef055d3e763827f2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Feb 2009 23:42:47 +0000 Subject: [PATCH] fix a bozobug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65589 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaInit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 1f4ab078ef..c4edbba751 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -39,6 +39,7 @@ static Expr *IsStringInit(Expr *Init, QualType DeclType, ASTContext &Context) { // Otherwise we can only handle string literals. StringLiteral *SL = dyn_cast(Init); + if (SL == 0) return 0; // char array can be initialized with a narrow string. // Only allow char x[] = "foo"; not char x[] = L"foo"; -- 2.40.0