From b8d091c4eba5714db7aee32a01bc330dfe5e052b Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 4 Mar 2009 22:30:12 +0000 Subject: Implemented access check for ivars accessed inside c-style functions declared inside objc @implementations. llvm-svn: 66087 --- clang/lib/Parse/ParseObjc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/lib/Parse/ParseObjc.cpp') diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 3637d144d63..1cbc0e77483 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -1082,12 +1082,15 @@ Parser::DeclTy *Parser::ParseObjCAtImplementationDeclaration( Parser::DeclTy *Parser::ParseObjCAtEndDeclaration(SourceLocation atLoc) { assert(Tok.isObjCAtKeyword(tok::objc_end) && "ParseObjCAtEndDeclaration(): Expected @end"); + DeclTy *Result = ObjCImpDecl; ConsumeToken(); // the "end" identifier - if (ObjCImpDecl) + if (ObjCImpDecl) { Actions.ActOnAtEnd(atLoc, ObjCImpDecl); + ObjCImpDecl = 0; + } else Diag(atLoc, diag::warn_expected_implementation); // missing @implementation - return ObjCImpDecl; + return Result; } /// compatibility-alias-decl: -- cgit v1.2.3