NoQ added inline comments.
================ Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:189 + if (const MemRegion *MRegion = PlaceVal.getAsRegion()) { + if (const ElementRegion *TheElementRegion = + MRegion->getAs<ElementRegion>()) { ---------------- NoQ wrote: > The sequence of `FieldRegion`s and `ElementRegion`s on top of a base region > may be arbitrary: `var.a[0].b[1][2].c.d[3]` etc. > > I'd rather unwrap those regions one-by-one in a loop and look at the > alignment of each layer. Alternatively, just decompose the whole region into base region and offset and see if base region has the necessary alignment and the offset is divisible by the necessary alignment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76996/new/ https://reviews.llvm.org/D76996 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits