-
Details
Diff Detail
Event Timeline
I am not sure how would I fix them, so I just commented them out.
clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp | ||
---|---|---|
102 | May it is more explicit. |
These assertions are fundamental, so we can't remove them; i believe we messed up modeling at some point. I'll pick this up to address some nasty regressions quickly; i managed to reproduce the crashes and i already have 4 creduces running.
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
743–751 | I don't think this does anything: 505 QualType Type::getPointeeType() const { 506 if (const auto *PT = getAs<PointerType>()) 507 return PT->getPointeeType(); 508 if (const auto *OPT = getAs<ObjCObjectPointerType>()) 509 return OPT->getPointeeType(); 510 if (const auto *BPT = getAs<BlockPointerType>()) 511 return BPT->getPointeeType(); 512 if (const auto *RT = getAs<ReferenceType>()) 513 return RT->getPointeeType(); 514 if (const auto *MPT = getAs<MemberPointerType>()) 515 return MPT->getPointeeType(); 516 if (const auto *DT = getAs<DecayedType>()) 517 return DT->getPointeeType(); 518 return {}; 519 } This getter usually works very reliably for both pointers and references. | |
clang/lib/StaticAnalyzer/Core/DynamicType.cpp | ||
118–122 ↗ | (On Diff #216615) | We shouldn't put null regions into our maps. |
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | ||
329–336 | This usually fails when we mess up lvalue/rvalue vs. loc/nonloc invariants in our modeling. | |
clang/lib/StaticAnalyzer/Core/MemRegion.cpp | ||
1079–1080 | Ugh, i suspect that we can't pass through the original pointer in our cast modeling; we need to actually model pointer casts, which is annoying but necessary, given that the cast doesn't necessarily yield the same pointer value even in run-time (see multiple inheritance). |
- The null MemRegion is a 0 (Loc), try to avoid to store it.
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
743–751 | I have measured each assertion failure one-by-one, so all of the hotfixes are necessary in order to reduce the crash-counter to zero. I have not got time to go in-depth, and have a great talk about them, sorry. | |
clang/lib/StaticAnalyzer/Core/DynamicType.cpp | ||
118–122 ↗ | (On Diff #216615) | Yes, but that is problematic. I have updated the diff. |
Wow, it is great you could address every of the edge cases. Thanks you so much! I believe only one problem left: we need to return false instead of plain return in order to let the Analyzer model the function call. I could fix it easily, thanks!
Well, not really. I have tested out and there is no difference. Thanks for the fixes!
May it is more explicit.