]> granicus.if.org Git - clang/commitdiff
Fixed off-by-one-error when resizing Bitvectors used for
authorTed Kremenek <kremenek@apple.com>
Mon, 10 Dec 2007 22:01:22 +0000 (22:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 10 Dec 2007 22:01:22 +0000 (22:01 +0000)
dataflow analysis over expressions and decls.

This should fix bug 1847:

http://llvm.org/bugs/show_bug.cgi?id=1847

Thanks to Török Edwin for providing a test case that
identified the problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44813 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/ExprDeclBitVector.h

index 4cd9faa260b729db42887ac08a3ba389909a0d3d..2ddd985f4c4e2a6fa867fb84f7cadbb3203d4673 100644 (file)
@@ -73,7 +73,7 @@ struct DeclBitVector_Types {
   public:
     
     void resetValues(AnalysisDataTy& AD) {
-      DeclBV.resize(AD.getNumDecls()); 
+      DeclBV.resize(AD.getNumDecls()+1); 
       DeclBV.reset();
     }
     
@@ -172,7 +172,7 @@ struct ExprDeclBitVector_Types {
     
     void resetValues(AnalysisDataTy& AD) {
       ParentRef(*this).resetValues(AD);
-      ExprBV.resize(AD.getNumExprs());
+      ExprBV.resize(AD.getNumExprs()+1);
       ExprBV.reset();
     }