[all-commits] [llvm/llvm-project] 429bc4: [CIR] Use cleanup active flag with logical operato...

Andy Kaylor via All-commits all-commits at lists.llvm.org
Tue Sep 22 17:33:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 429bc4e837c54335e17c7294b32d754f3d560a02
      https://github.com/llvm/llvm-project/commit/429bc4e837c54335e17c7294b32d754f3d560a02
  Author: Andy Kaylor <akaylor at nvidia.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
    M clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
    M clang/test/CIR/CodeGen/cleanup-conditional.cpp
    M clang/test/CIR/CodeGen/dtors.cpp

  Log Message:
  -----------
  [CIR] Use cleanup active flag with logical operators (#225554)

When temporary expressions are created within a logical binary
operation, we need to use a "cleanup active" flag to guard any cleanups
that are created in the right-hand side of the expression because the
expression may short-circuit and not evaluate the RHS. Failure to do so
had been leading to destructors being called for objects that had never
been constructed.

This fix introduces a regression in destructor call ordering when both
sides of a logical operation create temporaries that require cleanup.
This is a known ordering bug that preceeded this PR but was incidentally
avoided by the previous incorrect handling. The orderig bug will be
fixed in a follow-up change.

Assisted-by: Cursor / various models



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