diff options
Diffstat (limited to 'lib/Analysis/UndefBranchChecker.cpp')
-rw-r--r-- | lib/Analysis/UndefBranchChecker.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/UndefBranchChecker.cpp b/lib/Analysis/UndefBranchChecker.cpp index 0a66e21de9..b6861ba5a0 100644 --- a/lib/Analysis/UndefBranchChecker.cpp +++ b/lib/Analysis/UndefBranchChecker.cpp @@ -73,9 +73,6 @@ void UndefBranchChecker::VisitBranchCondition(GRBranchNodeBuilder &Builder, N->markAsSink(); if (!BT) BT = new BuiltinBug("Branch condition evaluates to a garbage value"); - EnhancedBugReport *R = new EnhancedBugReport(*BT, BT->getDescription(),N); - R->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, - Condition); // What's going on here: we want to highlight the subexpression of the // condition that is the most likely source of the "uninitialized @@ -105,6 +102,10 @@ void UndefBranchChecker::VisitBranchCondition(GRBranchNodeBuilder &Builder, FindUndefExpr FindIt(Eng.getStateManager(), St); Ex = FindIt.FindExpr(Ex); + + // Emit the bug report. + EnhancedBugReport *R = new EnhancedBugReport(*BT, BT->getDescription(),N); + R->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, Ex); R->addRange(Ex->getSourceRange()); Eng.getBugReporter().EmitReport(R); |