[clang] [analyzer] Modernize FuchsiaHandleChecker (PR #111588)

Pavel Skripkin via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 14 03:51:07 PDT 2024


pskrgag wrote:

> I'd love to better understand what is the root cause for these weird diagnostics when the functions are inlined

The problem was in `if (C.wasInlined)` logic in old version. So checker was not modeling all inlined functions. If we drop that check and just allow modeling inline functions, there will be a following problem:

```cpp
void close_outline(zx_handle_t handle ZX_ACQUIRE_HANDLE);

void close_inline(zx_handle_t handle ZX_ACQUIRE_HANDLE)  // <- Modeled close here. handle state is now "Closed"
{
   close_outline(handle);  // <- Use after close report
}
```

The same goes for `acquire` logic/

I guess, this kind of reports could be suppressed by custom bug visitor, but I thougth `evalCall` approach is more clean.

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


More information about the cfe-commits mailing list