diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-04 22:30:12 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-03-04 22:30:12 +0000 |
commit | a6e3ac514c924879699c6b0b1201028f0091044f (patch) | |
tree | fa654a8c63ee410e0fd5b0a99b6cc709ff313b01 /lib/Parse/ParseObjc.cpp | |
parent | 30b055f553ffa50ae5413ecf0f0ac8061c58f475 (diff) |
Implemented access check for ivars accessed inside
c-style functions declared inside objc @implementations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 3637d144d6..1cbc0e7748 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/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: |