[all-commits] [llvm/llvm-project] a46154: [analyzer] Warn if the size of the array in `new[]...

isuckatcs via All-commits all-commits at lists.llvm.org
Sun Sep 4 14:07:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a46154cb1cd09aa26bc803d8696e6e9283aac6a9
      https://github.com/llvm/llvm-project/commit/a46154cb1cd09aa26bc803d8696e6e9283aac6a9
  Author: isuckatcs <65320245+isuckatcs at users.noreply.github.com>
  Date:   2022-09-04 (Sun, 04 Sep 2022)

  Changed paths:
    M clang/docs/analyzer/checkers.rst
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
    M clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    A clang/lib/StaticAnalyzer/Checkers/UndefinedNewArraySizeChecker.cpp
    M clang/test/Analysis/Issue56873.cpp
    A clang/test/Analysis/undefined-new-element.cpp

  Log Message:
  -----------
  [analyzer] Warn if the size of the array in `new[]` is undefined

This patch introduces a new checker, called NewArraySize checker,
which detects if the expression that yields the element count of
the array in new[], results in an Undefined value.

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




More information about the All-commits mailing list