From: Ted Kremenek Date: Wed, 23 Dec 2009 01:09:59 +0000 (+0000) Subject: Add assertion to check for valid source ranges. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5083e6ab51b031241152e81457240497ab9bff9;p=clang Add assertion to check for valid source ranges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91966 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 58c8018543..ccebf01b76 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -203,7 +203,10 @@ public: ~RangedBugReport(); // FIXME: Move this out of line. - void addRange(SourceRange R) { Ranges.push_back(R); } + void addRange(SourceRange R) { + assert(R.isValid()); + Ranges.push_back(R); + } // FIXME: Move this out of line. void getRanges(const SourceRange*& beg, const SourceRange*& end) {