[all-commits] [llvm/llvm-project] 2fb3be: [analyzer] Fix crash for array-delete of UnknownVa...

tomasz-kaminski-sonarsource via All-commits all-commits at lists.llvm.org
Wed Nov 9 06:17:48 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fb3bec932ede7704724abb71e8270e0b4c201f6
      https://github.com/llvm/llvm-project/commit/2fb3bec932ede7704724abb71e8270e0b4c201f6
  Author: Tomasz Kamiński <tomasz.kamiński at sonarsource.com>
  Date:   2022-11-09 (Wed, 09 Nov 2022)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/DynamicExtent.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    M clang/test/Analysis/dtor-array.cpp

  Log Message:
  -----------
  [analyzer] Fix crash for array-delete of UnknownVal values.

We now skip the destruction of array elements for `delete[] p`,
if the value of `p` is UnknownVal and does not have corresponding region.
This eliminate the crash in `getDynamicElementCount` on that
region and matches the behavior for deleting the array of
non-constant range.

Reviewed By: isuckatcs

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




More information about the All-commits mailing list