a.sidorin added a comment.

This is a nice extension of https://reviews.llvm.org/D16063.



================
Comment at: lib/StaticAnalyzer/Core/RegionStore.cpp:1344
   // This is a signed value, since it's used in arithmetic with signed indices.
-  return svalBuilder.makeIntVal(RegionSize / EleSize, false);
+  return svalBuilder.makeIntVal(RegionSize / EleSize, Ctx.getSignedSizeType());
 }
----------------
I think we should initialize SValBuilder::ArrayIndexTy with getSignedSizeType() 
instead of LongLongTy and use `svalBuilder.getArrayIndexType()` here instead.


================
Comment at: test/Analysis/array-index.c:1
+// RUN: %clang_analyze_cc1 
-analyzer-checker=core,alpha.security.ArrayBound,alpha.unix.cstring.OutOfBounds 
-verify -Wno-implicit-function-declaration %s
+
----------------
Can we place these tests into Analysis/index-type.c?


Repository:
  rC Clang

https://reviews.llvm.org/D46944



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

Reply via email to