Index: cfe/trunk/lib/StaticAnalyzer/Core/IssueHash.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/IssueHash.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/IssueHash.cpp @@ -132,8 +132,11 @@ StringRef Str = GetNthLineOfFile(SM.getBuffer(L.getFileID(), L), L.getExpansionLineNumber()); - unsigned col = Str.find_first_not_of(Whitespaces); - col++; + StringRef::size_type col = Str.find_first_not_of(Whitespaces); + if (col == StringRef::npos) + col = 1; // The line only contains whitespace. + else + col++; SourceLocation StartOfLine = SM.translateLineCol(SM.getFileID(L), L.getExpansionLineNumber(), col); llvm::MemoryBuffer *Buffer =