[PATCH] D122513: [analyzer] Fix "RhsLoc and LhsLoc bitwidth must be same"

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 13:12:41 PDT 2022


NoQ added a comment.

I mean, regardless of whether we need to report a warning or an error against this code, the AST says that the RHS type and the LHS type are the same. This means that the same should have applied to our SVals that represent LHS and RHS, rendering `std::max(APSIntType(LHSValue), APSIntType(RHSValue))` redundant. So I suspect that the problem is not that we're not `std::max`ing hard enough, the problem is that our values weren't correct in the first place, so I think you need to take a look at the transfer function corresponding to statement

  ImplicitCastExpr 0x118f2040 <col:18, col:26> '__attribute__((address_space(3))) int *' <AddressSpaceConversion>

...and see why didn't it cause the type of the SVal to be updated with the address space attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122513



More information about the cfe-commits mailing list