Fix a null dereference Neil ran into

llvm-svn: 41564
This commit is contained in:
Chris Lattner 2007-08-29 16:03:41 +00:00
parent fb38f274ff
commit c92bc4ce2f
1 changed files with 2 additions and 1 deletions

View 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) {