// 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)
// 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;
return x; // expected-warning {{variable 'x' may be uninitialized when used here}}
}
+void test53() {
+ int x;
+ int y = (x);
+}
+
// This CFG caused the uninitialized values warning to inf-loop.
extern int PR10379_g();
void PR10379_f(int *len) {