[cfe-commits] r66741 - /cfe/trunk/lib/Sema/SemaExpr.cpp
steve naroff
snaroff at apple.com
Thu Mar 12 08:20:15 PDT 2009
On Mar 11, 2009, at 7:54 PM, Douglas Gregor wrote:
> Author: dgregor
> Date: Wed Mar 11 18:54:15 2009
> New Revision: 66741
>
> URL: http://llvm.org/viewvc/llvm-project?rev=66741&view=rev
> Log:
> Properly restore ActiveScope when we exit parsing of a block. This
> should fix the largest problem in <rdar://problem/6669847>.
>
Hi Doug,
I'm going to look into getting rid of ActiveScope (something I added
fairly recently to fix http://llvm.org/viewvc/llvm-project?view=rev&revision=65694.)
Sorry for the problems,
snaroff
> Modified:
> cfe/trunk/lib/Sema/SemaExpr.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=66741&r1=66740&r2=66741&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Mar 11 18:54:15 2009
> @@ -4591,11 +4591,18 @@
> // Ensure that CurBlock is deleted.
> llvm::OwningPtr<BlockSemaInfo> CC(CurBlock);
>
> + // Before popping CurBlock, set ActiveScope to this scope's
> function
> + // or block parent.
> + ActiveScope = CurBlock->TheScope->getParent();
> + while (ActiveScope &&
> + ((ActiveScope->getFlags() & (Scope::FnScope |
> Scope::BlockScope)) == 0))
> + ActiveScope = ActiveScope->getParent();
> +
> // Pop off CurBlock, handle nested blocks.
> CurBlock = CurBlock->PrevBlockInfo;
>
> // FIXME: Delete the ParmVarDecl objects as well???
> -
> +
> }
>
> /// ActOnBlockStmtExpr - This is called when the body of a block
> statement
> @@ -4608,8 +4615,12 @@
>
> PopDeclContext();
>
> - // Before poping CurBlock, set ActiveScope to this scopes parent.
> + // Before popping CurBlock, set ActiveScope to this scope's
> function
> + // or block parent.
> ActiveScope = CurBlock->TheScope->getParent();
> + while (ActiveScope &&
> + ((ActiveScope->getFlags() & (Scope::FnScope |
> Scope::BlockScope)) == 0))
> + ActiveScope = ActiveScope->getParent();
>
> // Pop off CurBlock, handle nested blocks.
> CurBlock = CurBlock->PrevBlockInfo;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list