[all-commits] [llvm/llvm-project] 2555f3: [LifetimeSafety] Treat std::unique_ptr::release() ...
Utkarsh Saxena via All-commits
all-commits at lists.llvm.org
Fri Feb 6 14:36:00 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2555f3b0edb5de40ba17076072a55bc3e997626d
https://github.com/llvm/llvm-project/commit/2555f3b0edb5de40ba17076072a55bc3e997626d
Author: Utkarsh Saxena <usx at google.com>
Date: 2026-02-06 (Fri, 06 Feb 2026)
Changed paths:
M clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
M clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
M clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
M clang/test/Sema/Inputs/lifetime-analysis.h
M clang/test/Sema/warn-lifetime-safety.cpp
Log Message:
-----------
[LifetimeSafety] Treat std::unique_ptr::release() as a move operation (#180230)
Add support for `std::unique_ptr::release()` in lifetime analysis to
avoid false positives when ownership is manually transferred via
`release()`.
- Added a new function `isUniquePtrRelease()` to detect when
`std::unique_ptr::release()` is called
- Modified `handleInvalidatingCall()` to mark the unique_ptr as moved
when release() is called
When manually transferring ownership using `std::unique_ptr::release()`,
the lifetime analysis would previously generate false positive
use-after-free warnings. This change treats `release()` as a move
operation, correctly modeling the ownership transfer semantics and
reducing false positives in code that manually manages ownership.
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