diff options
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index fb52067573..343ac697a3 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1820,6 +1820,14 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) { Expr* SE = VLA->getSizeExpr(); SVal Size = GetSVal(St, SE); + + if (Size.isUndef()) { + if (NodeTy* N = Builder->generateNode(DS, St, Pred)) { + N->markAsSink(); + ExplicitBadSizedVLA.insert(N); + } + continue; + } bool isFeasibleZero = false; const GRState* ZeroSt = Assume(St, Size, false, isFeasibleZero); @@ -1830,8 +1838,8 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) { if (isFeasibleZero) { if (NodeTy* N = Builder->generateNode(DS, ZeroSt, Pred)) { N->markAsSink(); - if (isFeasibleNotZero) ImplicitZeroSizedVLA.insert(N); - else ExplicitZeroSizedVLA.insert(N); + if (isFeasibleNotZero) ImplicitBadSizedVLA.insert(N); + else ExplicitBadSizedVLA.insert(N); } } |