[all-commits] [llvm/llvm-project] 5274b7: [LifetimeSafety] Model pointer-to-data-member acce...

Gábor Horváth via All-commits all-commits at lists.llvm.org
Tue Jun 23 09:42:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5274b7ffac47a891a932dcc630e6130cc72359ef
      https://github.com/llvm/llvm-project/commit/5274b7ffac47a891a932dcc630e6130cc72359ef
  Author: Gábor Horváth <xazax.hun at gmail.com>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    M clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
    M clang/test/Sema/LifetimeSafety/safety.cpp

  Log Message:
  -----------
  [LifetimeSafety] Model pointer-to-data-member access in the fact generator (#204612)

VisitBinaryOperator had no case for `obj.*pm` (BO_PtrMemD) /
`objptr->*pm` (BO_PtrMemI), so a borrow of the accessed member
(`&(obj.*pm)`) dropped the object's loan to an empty origin and a
use-after-scope was missed. Flow the object operand's origin into the
result, mirroring a member access: for `.*` the object is the LHS, for
`->*` it is the LHS pointer's pointee.

Assisted-by: Claude Opus 4.8

Co-authored-by: Gabor Horvath <gaborh at apple.com>



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