]> granicus.if.org Git - clang/commit
[analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPieces
authorCsaba Dabis <dabis.csaba98@gmail.com>
Fri, 9 Aug 2019 02:20:44 +0000 (02:20 +0000)
committerCsaba Dabis <dabis.csaba98@gmail.com>
Fri, 9 Aug 2019 02:20:44 +0000 (02:20 +0000)
commitf26add7ee19ae25f2f7c67e3706b0a0f865a29c0
tree86d48cf3d636552850d24334b051120c4a0565ce
parenta06acef0ab1d2599540fa01b4d994c4cf6e27f4c
[analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPieces

Summary:
A condition could be a multi-line expression where we create the highlight
in separated chunks. PathDiagnosticPopUpPiece is not made for that purpose,
it cannot be added to multiple lines because we have only one ending part
which contains all the notes. So that it cannot have multiple endings and
therefore this patch narrows down the ranges of the highlight to the given
interesting variable of the condition. It prevents HTML-breaking injections.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D65663

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368382 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
test/Analysis/Inputs/expected-plists/edges-new.mm.plist
test/Analysis/Inputs/expected-plists/inline-plist.c.plist
test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
test/Analysis/Inputs/expected-plists/plist-output.m.plist