Files
clang-p2996/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
Arseniy Zaostrovnykh 82e314e366 [analyzer] Fix false positive for mutexes inheriting mutex_base (#106240)
If a mutex interface is split in inheritance chain, e.g. struct mutex
has `unlock` and inherits `lock` from __mutex_base then calls m.lock()
and m.unlock() have different "this" targets: m and the __mutex_base of
m, which used to confuse the `ActiveCritSections` list.

Taking base region canonicalizes the region used to identify a critical
section and enables search in ActiveCritSections list regardless of
which class the callee is the member of.

This likely fixes #104241

CPP-5541
2024-08-28 11:30:18 +02:00

15 KiB