[PATCH] D115716: [Analyzer][BugReporter] Replace the example bug report with the one used to generate PathDiagnostic

Ella Ma via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 14 02:23:22 PST 2021


OikawaKirie created this revision.
OikawaKirie added reviewers: NoQ, steakhal, vsavchenko, ASDenysPetrov.
OikawaKirie added a project: clang.
Herald added subscribers: manas, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
OikawaKirie requested review of this revision.
Herald added a subscriber: cfe-commits.

In function `BugReporter::FlushReport`, function `PathSensitiveBugReporter::generatePathDiagnostics` will re-select one report from the equivalence class to construct the `PathDiagnostic`. It makes the report used to generate `PathDiagnostic` may be different from the one used in function `BugReporter::FlushReport`. Changes to the bug report via a `BugReporterVisitor` may not be reflected when generating report notes or fix-hints.

This patch tries to fix this problem by resetting the pointer to the example report selected in function `BugReporter::FlushReport` with the one used to generate `PathDiagnostic`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115716

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
  clang/lib/StaticAnalyzer/Core/BugReporter.cpp
  clang/test/Analysis/keychainAPI.m
  clang/test/Analysis/malloc-plist.c
  clang/test/Analysis/stream.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115716.394179.patch
Type: text/x-patch
Size: 6778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211214/aa140b7f/attachment-0001.bin>


More information about the cfe-commits mailing list