From: Chris Lattner Date: Thu, 26 Feb 2009 23:42:47 +0000 (+0000) Subject: fix a bozobug. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=220b6369d7717bfe6894b46cef055d3e763827f2;p=clang fix a bozobug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65589 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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";