[all-commits] [llvm/llvm-project] 89f2b9: [analyzer] Fix fragile logic in VisitCXXNewExpr (#...

Donát Nagy via All-commits all-commits at lists.llvm.org
Mon Aug 3 09:06:30 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89f2b9351909241964aa98a81aa6de19c931d66c
      https://github.com/llvm/llvm-project/commit/89f2b9351909241964aa98a81aa6de19c931d66c
  Author: Donát Nagy <donat.nagy at ericsson.com>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp

  Log Message:
  -----------
  [analyzer] Fix fragile logic in VisitCXXNewExpr (#213678)

This part of the engine code had assumed that an `evalBind` call always
produced exactly one transition. This was probably always satisfied by
the existing `eval::Bind` checkers (because the code is old and I don't
know about any bugs caused by this), but it was still fragile and
problematic to rely on this undocumented property of checkers.

This commit introduces a `for` loop to ensure that all nodes produced by
`evalBind` are handled in an identical manner (the same way as the
single node was handled previously).

(Note that not passing a `State` to `makeNodeWithBinding` is equivalent
to passing the state of the predecessor node.)

We noticed this problem during the review of the NFC commit
53ee7b167d8aee0a75c1332ca4a6aa037e0869a0 and decided to put this
(arguably non-NFC) change into a separate PR.



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