[PATCH] D118050: [analyzer] Different address spaces cannot overlap

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 05:53:08 PST 2022


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

Besides a couple of nits, it's ready for landing.
Thanks for the hard work @vabridgers!



================
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:726-727
+      LhsLoc.getType(Ctx).isNull() ? 0 : Ctx.getTypeSize(LhsLoc.getType(Ctx));
+  if (RhsBitwidth && LhsBitwidth &&
+      (LhsLoc.getSubKind() == RhsLoc.getSubKind())) {
+    assert(RhsBitwidth == LhsBitwidth &&
----------------
You should probably ignore references.
Ah, but we already lost that information. Well, that's bad.
Anyway. You probably don't need to check the subkinds. Do you?


================
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:745
+  // See LIT case clang/test/Analysis/cstring-checker-addressspace.c
+  assertEqualBitWidths(state, rhs, lhs);
+
----------------
You don't use the return value of this call.
Can we have a `void` return type instead?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118050/new/

https://reviews.llvm.org/D118050



More information about the cfe-commits mailing list