[cfe-dev] [Analyzer] Placement new related checker

Csaba Dabis via cfe-dev cfe-dev at lists.llvm.org
Mon Dec 9 05:05:24 PST 2019


A new idea is rising nowadays to split the checkers into two main
parts: one for modeling, one for checking for certain issues. In this
new form the MallocChecker.cpp needs to only contain the modeling. I
like the idea of having a separated checker for checking.

On Sat, Dec 7, 2019 at 4:58 PM Gábor Márton via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> Hi,
> I am working on a SEI CERT checker (Provide placement new with properly aligned pointers to sufficient storage capacity). This should give reports on the following:
> #include <new>
> void f() {
>   short s;
>   long *lp = ::new (&s) long; // warning: insufficient storage
> }
> First I thought, the best place for the implementation would be in the existing MallocChecker.cpp.
> However, there are a bunch of classes (e.g. the MallocBugVisitor) which seems to be unrelated and not needed for this new check. Now I am fidgeting because maybe it would be better to have a self-contained independent .cpp file for the implementation. What do you think, what do you suggest?
> Thanks,
> Gabor
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list