[all-commits] [llvm/llvm-project] f4af60: [analyzer] Fix false double free when including 3r...

Ella Ma via All-commits all-commits at lists.llvm.org
Thu Oct 31 09:02:49 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4af60dfbb6a2e3d5628b8f07b4895ddbe24d459
      https://github.com/llvm/llvm-project/commit/f4af60dfbb6a2e3d5628b8f07b4895ddbe24d459
  Author: Ella Ma <alansnape3058 at gmail.com>
  Date:   2024-10-31 (Thu, 31 Oct 2024)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    A clang/test/Analysis/Inputs/overloaded-delete-in-header.h
    A clang/test/Analysis/overloaded-delete-in-system-header.cpp

  Log Message:
  -----------
  [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (#85224)

Fixes #62985
Fixes #58820

When 3rd-party header files are included as system headers, their
overloaded `new` and `delete` operators are also considered as the std
ones. However, those overloaded operator functions will also be inlined.
This makes the same
symbolic memory marked as released twice: during `checkPreCall` of the
overloaded `delete` operator and when calling `::operator delete` after
inlining the overloaded operator function (if it has).

This patch attempts to fix this bug by adjusting the strategy of
verifying whether the callee is a standard `new` or `delete` operator in
the `isStandardNewDelete` function.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list