llvm-project
05860f9b - [WebKit checkers] Recognize ensureFoo functions (#119681)

Commit
293 days ago
[WebKit checkers] Recognize ensureFoo functions (#119681) In WebKit, we often write Foo::ensureBar function which lazily initializes m_bar and returns a raw pointer or a raw reference to m_bar. Such a return value is safe to use for the duration of a member function call in Foo so long as m_bar is const so that it never gets unset or updated with a new value once it's initialized. This PR adds support for recognizing these types of functions and treating its return value as a safe origin of a function argument (including "this") or a local variable.
Author
Parents
Loading