summaryrefslogtreecommitdiffstats
path: root/clang/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
commit309e48695b9533db3c6e37e15dd4ebc57a0dd351 (patch)
treed9fbb3ffea4b3a0643c91bbfd6e080cb7541a637 /clang/lib/Sema/SemaDecl.cpp
parentd4ed7e8bb9fae939e2bf127af7e2e0b50aacbb36 (diff)
downloadbcm5719-llvm-309e48695b9533db3c6e37e15dd4ebc57a0dd351.tar.gz
bcm5719-llvm-309e48695b9533db3c6e37e15dd4ebc57a0dd351.zip
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. llvm-svn: 65708
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 98b8dbc9c07..c9b5405fbe1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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;
}
}
OpenPOWER on IntegriCloud