From e9ca85163e03310f28090fdda95c7b538ef1d05b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 29 Aug 2007 16:03:41 +0000 Subject: [PATCH] Fix a null dereference Neil ran into git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41564 91177308-0d34-0410-b5e6-96231b3b80d8 --- Sema/SemaDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 4510f00d0c..425743aa32 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -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) {