NoQ accepted this revision. NoQ added a comment. I mean, the extent of an `ElementRegion` //is// the size of a single element. The reason why our intrinsic isn't doing what you expect is because we represent the pointer with offset as `ElementRegion` regardless of whether operator `[]` was used. On the other hand, an `SVal` doesn't ever represent a region at all, it only points to its first byte, regardless of the structure of `MemRegion` inside it; for that reason `clang_analyzer_getExtent()` is impossible to implement correctly in our current model.
So i think both behaviors are incorrect but if you think it makes it easier to write tests then absolutely go for it! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99658/new/ https://reviews.llvm.org/D99658 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits