]> granicus.if.org Git - clang/commitdiff
fix a bozobug.
authorChris Lattner <sabre@nondot.org>
Thu, 26 Feb 2009 23:42:47 +0000 (23:42 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Feb 2009 23:42:47 +0000 (23:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65589 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp

index 1f4ab078efa777a6170866f0a3ffd26a1a8cc2b0..c4edbba751b9f535e40b0dd049f83d10082bd631 100644 (file)
@@ -39,6 +39,7 @@ static Expr *IsStringInit(Expr *Init, QualType DeclType, ASTContext &Context) {
 
   // Otherwise we can only handle string literals.
   StringLiteral *SL = dyn_cast<StringLiteral>(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";