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 | ee9848e20d2659f939fb6e773729c6a86e6ed1da (patch) | |
tree | 9450556c0201c0061b7da6dc3c44582f5a0b79d9 /clang/lib/Analysis/CFG.cpp | |
parent | 43c322b5b2de0b89d2b282f5d98785b269a6e2b3 (diff) | |
download | bcm5719-llvm-ee9848e20d2659f939fb6e773729c6a86e6ed1da.tar.gz bcm5719-llvm-ee9848e20d2659f939fb6e773729c6a86e6ed1da.zip |
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>.
llvm-svn: 138372
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r-- | clang/lib/Analysis/CFG.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 65dabda7e76..e0905eda218 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/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; } |