From: Jordan Rose Date: Mon, 2 Jul 2012 21:41:56 +0000 (+0000) Subject: [analyzer] If 'super' is known to be nil, we can still mark its range. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb3cc8be6941edc44cf2176335fa6090d8ff4425;p=clang [analyzer] If 'super' is known to be nil, we can still mark its range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159596 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp index 2f95709e03..69b331c16c 100644 --- a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -310,9 +310,9 @@ void CallAndMessageChecker::emitNilReceiverBug(CheckerContext &C, os << "' that will be garbage"; BugReport *report = new BugReport(*BT_msg_ret, os.str(), N); + report->addRange(msg.getReceiverSourceRange()); // FIXME: This won't track "self" in messages to super. if (const Expr *receiver = msg.getInstanceReceiverExpr()) { - report->addRange(receiver->getSourceRange()); report->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N, receiver, report));