diff --git a/clang/AST/CFG.cpp b/clang/AST/CFG.cpp index 0c8589b058ea..b93d77e3fa06 100644 --- a/clang/AST/CFG.cpp +++ b/clang/AST/CFG.cpp @@ -969,8 +969,10 @@ static BlkExprMapTy* PopulateBlkExprMap(CFG& cfg) { for (CFG::iterator I=cfg.begin(), E=cfg.end(); I != E; ++I) for (CFGBlock::iterator BI=I->begin(), EI=I->end(); BI != EI; ++BI) - if (const Expr* E = dyn_cast(*BI)) - (*M)[E] = M->size(); + if (const Expr* E = dyn_cast(*BI)) { + unsigned x = M->size(); + (*M)[E] = x; + } return M; } diff --git a/clang/include/clang/Analysis/ExprDeclBitVector.h b/clang/include/clang/Analysis/ExprDeclBitVector.h index 2ddd985f4c4e..4cd9faa260b7 100644 --- a/clang/include/clang/Analysis/ExprDeclBitVector.h +++ b/clang/include/clang/Analysis/ExprDeclBitVector.h @@ -73,7 +73,7 @@ struct DeclBitVector_Types { public: void resetValues(AnalysisDataTy& AD) { - DeclBV.resize(AD.getNumDecls()+1); + DeclBV.resize(AD.getNumDecls()); DeclBV.reset(); } @@ -172,7 +172,7 @@ struct ExprDeclBitVector_Types { void resetValues(AnalysisDataTy& AD) { ParentRef(*this).resetValues(AD); - ExprBV.resize(AD.getNumExprs()+1); + ExprBV.resize(AD.getNumExprs()); ExprBV.reset(); }