diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-07-19 20:33:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-07-19 20:33:49 +0000 |
commit | 5d855bf7f2ae2c740fce9d2243a6f6f016c03150 (patch) | |
tree | 8dcb9d55e4a3d5037e66e0bdf59cc2d70131d37b /clang/lib/Analysis/UninitializedValues.cpp | |
parent | a39e10fd7c71657abec87ffc6eeab40d12b8ffc9 (diff) | |
download | bcm5719-llvm-5d855bf7f2ae2c740fce9d2243a6f6f016c03150.tar.gz bcm5719-llvm-5d855bf7f2ae2c740fce9d2243a6f6f016c03150.zip |
Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.
llvm-svn: 135519
Diffstat (limited to 'clang/lib/Analysis/UninitializedValues.cpp')
-rw-r--r-- | clang/lib/Analysis/UninitializedValues.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp index 8dbade1d5f3..a64c1db530d 100644 --- a/clang/lib/Analysis/UninitializedValues.cpp +++ b/clang/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; |