if (state->getSVal(VR).isUndef())
if (ExplodedNode *N = C.generateSink()) {
if (!BT)
- BT = new BuiltinBug("Captured block variable is uninitialized");
+ BT = new BuiltinBug("uninitialized variable captured by block");
// Generate a bug report.
llvm::SmallString<128> buf;
llvm::raw_svector_ostream os(buf);
- os << "Variable '" << VD->getName() << "' is captured by block with "
- "a garbage value";
+ os << "Variable '" << VD->getName()
+ << "' is uninitialized when captured by block";
EnhancedBugReport *R = new EnhancedBugReport(*BT, os.str(), N);
if (const Expr *Ex = FindBlockDeclRefExpr(BE->getBody(), VD))
void test2() {
static int y = 0;
int x;
- ^{ y = x + 1; }(); // expected-warning{{Variable 'x' is captured by block with a garbage value}}
+ ^{ y = x + 1; }(); // expected-warning{{Variable 'x' is uninitialized when captured by block}}
}
void test2_b() {
void test2_c() {
typedef void (^myblock)(void);
- myblock f = ^() { f(); }; // expected-warning{{Variable 'f' is captured by block with a garbage value}}
+ myblock f = ^() { f(); }; // expected-warning{{Variable 'f' is uninitialized when captured by block}}
}
\ No newline at end of file