[PATCH] D126481: [analyzer] Handle SymbolCast in SValBuilder

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 02:35:20 PDT 2022


martong added a comment.

Actually, you already have a logic for checking if there is a contradiction in your D103096 <https://reviews.llvm.org/D103096> patch, in ConstraintAssignor::updateExistingConstraints:

  // Update constraints in the map which bitwidth is equal or lower then
  // `MinBitWidth`.
  if (CM) {
    for (auto &Item : *CM) {
      // Stop after reaching a bigger bitwidth.
      if (Item.first > MinBitWidth)
        break;
      RangeSet RS = RangeFactory.intersect(Item.second, CastTo(Item.first));
      // If the intersection is empty, then the branch is infisible.
      if (RS.isEmpty()) {
        State = nullptr;
        return false;
      }
      NewCM = CMF.add(NewCM, Item.first, RS);
    }
  }

So, the intersection should be empty in the above mentioned ambiguous case, shouldn't' it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126481



More information about the cfe-commits mailing list