llvm-project
01934fb4 - [LifetimeSafety] See through implicit object arguments of GSL pointer type (#174741)

Commit
51 days ago
[LifetimeSafety] See through implicit object arguments of GSL pointer type (#174741) Add support for tracking pointer flows through GSL pointer implicit object arguments in method calls. This PR enhances the lifetime safety analysis to properly track pointer flows through GSL pointer implicit object arguments in method calls. It adds a new helper function `shouldTrackPointerImplicitObjectArg` that determines if an implicit object argument should be tracked as a GSL pointer. When such an argument is detected, the analysis now correctly propagates the origin information through the pointer reference. This resolves false-positives like ```cpp const char* p; { std::string_view a = getSomeView(); p = a.data(); // 'a' does not live long enough (false-positive). } use(p); ```
Author
Parents
Loading