[PATCH] D46944: [analyzer] Use sufficiently large types for index/size calculation.

Bevin Hansson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 24 00:11:15 PDT 2018

ebevhan added inline comments.

Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h:89
         SymMgr(context, BasicVals, alloc), MemMgr(context, alloc),
-        StateMgr(stateMgr), ArrayIndexTy(context.LongLongTy),
+        StateMgr(stateMgr), ArrayIndexTy(context.getSignedSizeType()),
         ArrayIndexWidth(context.getTypeSize(ArrayIndexTy)) {}
a.sidorin wrote:
> As you correctly pointed, ssize_t is 32-bit on 32-bit systems. Therefore, it is too short. So, we can leave this line as-is.
But if it's hardcoded to LongLongTy, you have the same problem on 64-bit systems.


More information about the cfe-commits mailing list