diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 00:49:12 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 00:49:12 +0000 |
commit | c645ddf240efb112ff8f17371811deb3ebc1a5b5 (patch) | |
tree | 870eed23ef17135d561c082f77c0583eae277c32 /lib/Sema/SemaDecl.cpp | |
parent | 34ff062936ac78142a2c0dc8d1ae6a40df456819 (diff) |
objc: don't crash if primary class is missing and continuation class
is declaring ivars. // rdar://10752081
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 87bcfe9127..6ace744fc3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -9045,6 +9045,8 @@ Decl *Sema::ActOnIvar(Scope *S, : ObjCIvarDecl::None; // Must set ivar's DeclContext to its enclosing interface. ObjCContainerDecl *EnclosingDecl = cast<ObjCContainerDecl>(CurContext); + if (!EnclosingDecl || EnclosingDecl->isInvalidDecl()) + return 0; ObjCContainerDecl *EnclosingContext; if (ObjCImplementationDecl *IMPDecl = dyn_cast<ObjCImplementationDecl>(EnclosingDecl)) { |