forked from OSchip/llvm-project
Pop block scope after reading from it.
Found by valgrind. llvm-svn: 134983
This commit is contained in:
parent
b804a2b751
commit
a4fb836f06
|
@ -8496,10 +8496,6 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
|
|||
|
||||
BSI->TheDecl->setBody(cast<CompoundStmt>(Body));
|
||||
|
||||
BlockExpr *Result = new (Context) BlockExpr(BSI->TheDecl, BlockTy);
|
||||
|
||||
const AnalysisBasedWarnings::Policy &WP = AnalysisWarnings.getDefaultPolicy();
|
||||
PopFunctionOrBlockScope(&WP, Result->getBlockDecl(), Result);
|
||||
for (BlockDecl::capture_const_iterator ci = BSI->TheDecl->capture_begin(),
|
||||
ce = BSI->TheDecl->capture_end(); ci != ce; ++ci) {
|
||||
const VarDecl *variable = ci->getVariable();
|
||||
|
@ -8509,6 +8505,10 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
|
|||
getCurFunction()->setHasBranchProtectedScope();
|
||||
}
|
||||
|
||||
BlockExpr *Result = new (Context) BlockExpr(BSI->TheDecl, BlockTy);
|
||||
const AnalysisBasedWarnings::Policy &WP = AnalysisWarnings.getDefaultPolicy();
|
||||
PopFunctionOrBlockScope(&WP, Result->getBlockDecl(), Result);
|
||||
|
||||
return Owned(Result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue