aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/UninitializedValues.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-19 20:33:49 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-19 20:33:49 +0000
commitd626ec404fd0f27244363200f1a85a7db219cd11 (patch)
tree895702366a72b2882138bf368918e9e0ca181363 /lib/Analysis/UninitializedValues.cpp
parent4cc1187e8a04f1f36e8c3656f65097e770bdc437 (diff)
Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135519 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/UninitializedValues.cpp')
-rw-r--r--lib/Analysis/UninitializedValues.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp
index 8dbade1d5f..a64c1db530 100644
--- a/lib/Analysis/UninitializedValues.cpp
+++ b/lib/Analysis/UninitializedValues.cpp
@@ -462,7 +462,8 @@ void TransferFunctions::VisitDeclStmt(DeclStmt *ds) {
// appropriately, but we need to continue to analyze subsequent uses
// of the variable.
if (init == lastLoad) {
- DeclRefExpr *DR = cast<DeclRefExpr>(lastLoad->getSubExpr());
+ DeclRefExpr *DR =
+ cast<DeclRefExpr>(lastLoad->getSubExpr()->IgnoreParens());
vals[vd] = (DR->getDecl() == vd) ? Uninitialized : Initialized;
lastLoad = 0;
if (lastDR == DR)
@@ -562,7 +563,7 @@ void TransferFunctions::ProcessUses(Stmt *s) {
// If we reach here, we have seen a load of an uninitialized value
// and it hasn't been casted to void or otherwise handled. In this
// situation, report the incident.
- DeclRefExpr *DR = cast<DeclRefExpr>(lastLoad->getSubExpr());
+ DeclRefExpr *DR = cast<DeclRefExpr>(lastLoad->getSubExpr()->IgnoreParens());
VarDecl *VD = cast<VarDecl>(DR->getDecl());
reportUninit(DR, VD, isAlwaysUninit(vals[VD]));
lastLoad = 0;