aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-28 19:37:57 +0000
committerChris Lattner <sabre@nondot.org>2009-02-28 19:37:57 +0000
commitf306f86d2b85e820f5d1f397e4441d52373823d6 (patch)
tree265ba9d6bdb788ba4c9599c3d7a5fbcd592fec29 /lib/Sema/SemaDecl.cpp
parent56627e67a8dea1a85861dd0b97e40ee090826931 (diff)
Fix a crash in test/Parser/control-scope.c that testrunner didn't
notice because it was a negative test with a fix suggested by Jean-Daniel Dupas. Convert the test from a negative to a positive test to catch stuff like this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 98b8dbc9c0..c9b5405fbe 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3497,7 +3497,7 @@ Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
else
Diag(IdLoc, diag::err_redefinition) << Id;
Diag(PrevDecl->getLocation(), diag::note_previous_definition);
- Val->Destroy(Context);
+ if (Val) Val->Destroy(Context);
return 0;
}
}