]> granicus.if.org Git - clang/commitdiff
Fix a null dereference Neil ran into
authorChris Lattner <sabre@nondot.org>
Wed, 29 Aug 2007 16:03:41 +0000 (16:03 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 29 Aug 2007 16:03:41 +0000 (16:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41564 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp

index 4510f00d0c1e67d8ab4dcdae917f9dc572ad2d07..425743aa320fe71e099aac23022dc5458f10f9b3 100644 (file)
@@ -965,8 +965,9 @@ Sema::DeclTy *Sema::ParseEnumConstant(Scope *S, DeclTy *theEnumDecl,
            Id->getName());
       // FIXME: Don't leak memory: delete Val;
       Val = 0;  // Just forget about it.
+    } else {
+      EltTy = Val->getType();
     }
-    EltTy = Val->getType();
   }
   
   if (!Val) {