NoQ added a comment.

Let's land this then!~~



================
Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:83-93
+static QualType getRecordType(QualType Ty) {
+  Ty = Ty.getCanonicalType();
+
+  if (Ty->isPointerType())
+    return getRecordType(Ty->getPointeeType());
 
+  if (Ty->isReferenceType())
----------------
Charusso wrote:
> NoQ wrote:
> > NoQ wrote:
> > > Most of the time we should know exactly how many pointer/reference types 
> > > we need to unwrap. I really prefer we hard-assert this knowledge instead 
> > > of blindly unwrapping as many pointer/reference types as we want. Because 
> > > every time we have an unexpected number of unwraps it's an indication 
> > > that something went horribly wrong. So it's good to have the extra sanity 
> > > checking.
> > I think this one is still forgotten. Maybe a FIXME?
> Now I pattern-match that rule in the `evalCall()`, therefore we cannot try to 
> evaluate nested references. Would you like to see more checks?
Oh, i see, you removed the recursion. Great.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66325/new/

https://reviews.llvm.org/D66325



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to