[clang] [analyzer] Detect dangling pointers passed to function calls (PR #211045)

Benedek Kaibas via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 12:49:21 PDT 2026


benedekaibas wrote:

> Feel free to leave `recieve` opaque.

I have simplified it, the checker still does not detect the dangling pointer. I have also built the exploded graph for it. 
<img width="631" height="376" alt="Screenshot 2026-07-21 at 21 45 16" src="https://github.com/user-attachments/assets/3c8a615d-dcb1-489e-823e-f919719038b1" />

I think in order to handle these cases the checker should "see inside" the struct and then walk the fields. If a given field is related to lifetime analysis (pointer/reference type fields) then check if they point to deallocated region.

https://github.com/llvm/llvm-project/pull/211045


More information about the cfe-commits mailing list