aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-23 18:12:03 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-23 18:12:03 +0000
commit616cf051d45b9e5294da36aaa40b09d79a9eddc4 (patch)
tree14589daaffc80caf06bfa3d6a9ed4a15e65c6d55 /lib/Analysis
parent04765ac135e0c4e6b78651c2a287d80a32b2b8b9 (diff)
Tweak UndefBranchChecker to register the most nested "undefined" expression with bugreporter::registerTrackNullOrUndefValue instead of the condition itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/UndefBranchChecker.cpp7
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);