[PATCH] D37478: [analyzer] Implement pointer arithmetic on constants

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 04:08:25 PDT 2017


xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.

One nit, otherwise LGTM! Thanks for fixing this!



================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:938
       llvm::APSInt Multiplicand(rightI.getBitWidth(), /* isUnsigned */ true);
+      QualType PteeTy = resultTy.getTypePtr()->castAs<PointerType>()->getPointeeType();
+      Multiplicand = getContext().getTypeSizeInChars(PteeTy).getQuantity();
----------------
The rest of the code does not abbreviate the Type. I would prefer to name this `pointeeType`.


https://reviews.llvm.org/D37478





More information about the cfe-commits mailing list