diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-08-23 20:30:50 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-08-23 20:30:50 +0000 |
commit | 540dda6f2e4982b3eab0300c804345f5b6104c11 (patch) | |
tree | 60bb12eac0974176b55bd9d1cb0264521f79ebbd /lib/Analysis/CFG.cpp | |
parent | e0a5d326137c13946603c739babc722fd1e9a94f (diff) |
Fix regression in -Wuninitialized involving VLAs. It turns out that we were modeling sizeof(VLAs)
incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.
Fixes <rdar://problem/10008112>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r-- | lib/Analysis/CFG.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 65dabda7e7..e0905eda21 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -2203,16 +2203,7 @@ CFGBlock *CFGBuilder::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E, for (const VariableArrayType *VA =FindVA(E->getArgumentType().getTypePtr()); VA != 0; VA = FindVA(VA->getElementType().getTypePtr())) lastBlock = addStmt(VA->getSizeExpr()); - } else { - // For sizeof(x), where 'x' is a VLA, we should include the computation - // of the lvalue of 'x'. - Expr *subEx = E->getArgumentExpr(); - if (subEx->getType()->isVariableArrayType()) { - assert(subEx->isLValue()); - lastBlock = addStmt(subEx); - } } - return lastBlock; } |