[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-12-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:522 +symVal = peekCXXNewAllocatorValue(State); + State = popCXXNewAllocatorValue(State); + a.sidorin wrote: > Should this be under 'if' as well? Whops!! Thanks!

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-12-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 127420. NoQ added a comment. - Fix pop from empty stack. - Add recursive operator new tests. - Disable argument invalidation when the allocator was inlined (needed for those tests to work) In https://reviews.llvm.org/D40560#957653, @xazax.hun wrote: > I

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-12-18 Thread Aleksei Sidorin via Phabricator via cfe-commits
a.sidorin added a comment. Hi Artem. This patch looks OK, just stylish issues. Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:112 + // It means that we cannot handle construction into null or garbage pointers. + // Such cosntructors need to be handled by checkers to

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-12-16 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D40560#947514, @NoQ wrote: > Replaced the live expression hack with a slightly better approach. It doesn't > update the live variables analysis to take `CFGNewAllocator` into account, > but at least tests now pass. > > In order to keep the

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-12-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 125850. NoQ added a comment. Replaced the live expression hack with a slightly better approach. It doesn't update the live variables analysis to take `CFGNewAllocator` into account, but at least tests now pass. In order to keep the return value produced by the

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-11-28 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > for the sake of this proof-of-concept, i've crudely disabled garbage > collection on the respective moments of time Forgot to mention that this breaks tests in `NewDeleteLeaks-PR19102.cpp`, which are still failing in the present revision. Leak warnings get delayed to

[PATCH] D40560: [analyzer] WIP: Get construction into `operator new` running in simple cases.

2017-11-28 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. Herald added subscribers: rnkovacs, eraman. Under the assumption of `-analyzer-config c++-allocator-inlining=true`, which enables evaluation of `operator new` as a regular function call, this patch shows what it takes to actually inline the constructor into the