[PATCH] D48325: [analyzer][UninitializedObjectChecker] Support for MemberPointerTypes

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 26 17:59:41 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added a comment.
This revision now requires changes to proceed.

Requesting changes or clarification on uninitialized references.



================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:392
 
-    if (T->isMemberPointerType()) {
-      if (isMemberPointerUninit(FR, LocalChain))
+    if (T->isPointerType() || T->isReferenceType()) {
+      if (isPointerOrReferenceUninit(FR, LocalChain))
----------------
I am confused here, how can references be uninitialized?


================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:393
+    if (T->isPointerType() || T->isReferenceType()) {
+      if (isPointerOrReferenceUninit(FR, LocalChain))
         ContainsUninitField = true;
----------------
Same question here (though that's for a different commit) -- I'm confused on how a reference can be uninitialized after the constructor call has finished.


https://reviews.llvm.org/D48325





More information about the cfe-commits mailing list