[PATCH] D14919: Fix IssueHash generation

Gyorgy Orban via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 05:50:30 PST 2015


o.gyorgy created this revision.
o.gyorgy added reviewers: zaks.anna, xazax.hun, dcoughlin, jordan_rose.
o.gyorgy added a subscriber: cfe-commits.

Fixing IssueHash generation.
There were some problems with the current version.

If the Decl *D pointer is nullptr the NormalizeLine would crash while getting the LangOptions. The required LangOptions can be provided by the HTML or Plist Diagnostics.

It is possible that the column number provided by the find_first_not_of is 0 in that case the Lexer reads up a wrong source line (translateLineCol requires that column numbering should start at 1).

I think there should be an assert checking the line and col values in the sourcemanagers translateLineCol. The same way as in translateFileLineCol which does this check.

http://reviews.llvm.org/D14919

Files:
  include/clang/StaticAnalyzer/Core/IssueHash.h
  lib/Basic/SourceManager.cpp
  lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
  lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  lib/StaticAnalyzer/Core/IssueHash.cpp
  lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
  test/Analysis/bug_hash_test.cpp
  test/Analysis/diagnostics/report-issues-within-main-file.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14919.40916.patch
Type: text/x-patch
Size: 8914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151123/98ffc243/attachment.bin>


More information about the cfe-commits mailing list