[PATCH] D48325: [analyzer][UninitializedObjectChecker] Support for MemberPointerTypes
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 26 18:02:02 PDT 2018
NoQ added inline comments.
================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:392
- if (T->isMemberPointerType()) {
- if (isMemberPointerUninit(FR, LocalChain))
+ if (T->isPointerType() || T->isReferenceType()) {
+ if (isPointerOrReferenceUninit(FR, LocalChain))
----------------
george.karpenkov wrote:
> I am confused here, how can references be uninitialized?
Hmm, that's actually a good question. I guess we technically initialize a reference with an undefined pointer, but that should be caught by another checker early because it's an immediate UB.
In any case, there don't seem to be tests for this.
https://reviews.llvm.org/D48325
More information about the cfe-commits
mailing list