[PATCH] D26837: [analyzer] Litter the SVal/SymExpr/MemRegion class hierarchy with asserts.

Anna Zaks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 22:15:18 PST 2016


zaks.anna added inline comments.


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:737
 ///  either a real region, a NULL pointer, etc.  It essentially is used to
 ///  map the concept of symbolic values into the domain of regions.  Symbolic
 ///  regions do not need to be typed.
----------------
zaks.anna wrote:
> This comment states that SymbolicRegions do not need to be typed and the assert states that it has to be a pointer type.
> 
> Also, what about nullPointerType, isMemberPointerType? I am afraid that our test coverage is not very good and might not catch all cases.
> 
> I guess isArrayType() and void types are not expected here?
> 
Ah, right, we would not create a SymbolicRegion for nullPointerType.

This assertion feels a bit a bit superficial as if we are adding the known existing uses here, instead of asserting the capabilities/assumptions of the data structure itself. (But I can be convinced otherwise.)


https://reviews.llvm.org/D26837





More information about the cfe-commits mailing list