diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-09-28 00:13:36 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-09-28 00:13:36 +0000 |
| commit | edec9ba58dd7f5bdbc9e9307801f9c39c94c44c1 (patch) | |
| tree | ed541f76c754fc74f54915186272ef575ff391b5 /clang/lib/Sema/SemaExpr.cpp | |
| parent | 843fe14fab94a093db9fc5c0fd409ddf00e30718 (diff) | |
| download | bcm5719-llvm-edec9ba58dd7f5bdbc9e9307801f9c39c94c44c1.tar.gz bcm5719-llvm-edec9ba58dd7f5bdbc9e9307801f9c39c94c44c1.zip | |
Fix <rdar://problem/6252226> parser thinks block argument is undefined identifier in NSServices.m
llvm-svn: 56761
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e8b4d8cb4b3..dfa53ac4398 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -366,9 +366,14 @@ Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc, } // If we are parsing a block, check the block parameter list. if (CurBlock) { - for (unsigned i = 0, e = CurBlock->Params.size(); i != e; ++i) - if (CurBlock->Params[i]->getIdentifier() == &II) - D = CurBlock->Params[i]; + BlockSemaInfo *BLK = CurBlock; + do { + for (unsigned i = 0, e = BLK->Params.size(); i != e && D == 0; ++i) + if (BLK->Params[i]->getIdentifier() == &II) + D = BLK->Params[i]; + if (D) + break; // Found! + } while ((BLK = BLK->PrevBlockInfo)); // Look through any enclosing blocks. } if (D == 0) { // Otherwise, this could be an implicitly declared function reference (legal |

