[PATCH] D158156: [analyzer] Add C++ array delete checker

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 04:44:26 PDT 2023


donat.nagy added inline comments.


================
Comment at: clang/docs/analyzer/checkers.rst:1793-1803
+.. code-block:: cpp
+
+ Base *create() {
+   Base *x = new Derived[10]; // note: conversion from derived to base
+                              //       happened here
+   return x;
+ }
----------------
steakhal wrote:
> Discookie wrote:
> > steakhal wrote:
> > > Make sure in the example the `create` is related (e.g. called/used).
> > > Also, refrain from using `sink` in the docs. It's usually used in the context of taint analysis.
> > Changed the example - should I change the DeleteWithNonVirtualDtor example as well? That has the same issues as you said here.
> I have no opinion. You could.
I think you should definitely update it, for the sake of consistency and just improving things whenever we can. This commit already touches the code of that checker, there is no point in leaving bad documentation behind us...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158156/new/

https://reviews.llvm.org/D158156



More information about the cfe-commits mailing list