Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-08 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL277989: [analyzer] Model base to derived casts more precisely. (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D23014?vs=66632=67136#toc Repository: rL LLVM

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-08 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. What do you think about escaping pointers that gone through conservatively evaluated casts? https://reviews.llvm.org/D23014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-03 Thread Gábor Horváth via cfe-commits
xazax.hun updated this revision to Diff 66632. xazax.hun marked 4 inline comments as done. xazax.hun added a comment. - Improvements according to review comments. https://reviews.llvm.org/D23014 Files: include/clang/StaticAnalyzer/Core/PathSensitive/Store.h

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-02 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. Other than a naming/documentation suggestion, looks good to me. Thanks Gábor! Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:424 @@ +423,3 @@ +if (!val.isZeroConstant()) { + val = getStoreManager().evalDynamicCast(val, T,

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-02 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:423 @@ +422,3 @@ + +if (!val.isZeroConstant()) { + val = getStoreManager().evalDynamicCast(val, T, Failed); xazax.hun wrote: > NoQ wrote: > > I guess if `val` is a

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-02 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:423 @@ +422,3 @@ + +if (!val.isZeroConstant()) { + val = getStoreManager().evalDynamicCast(val, T, Failed); NoQ wrote: > I guess if `val` is a //non-zero//

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-02 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:423 @@ +422,3 @@ + +if (!val.isZeroConstant()) { + val = getStoreManager().evalDynamicCast(val, T, Failed); I guess if `val` is a //non-zero// constant, it wouldn't

Re: [PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-01 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: test/Analysis/NewDelete-checker-test.cpp:394 @@ +393,3 @@ + Derived *p = (Derived *)allocate(); + delete p; +} Before the modification the analyzer reports a leak here, since the symbol returned by the BaseToDerived

[PATCH] D23014: [analyzer] Model base to derived casts more precisely.

2016-08-01 Thread Gábor Horváth via cfe-commits
xazax.hun created this revision. xazax.hun added reviewers: zaks.anna, dcoughlin, dergachev.a, a.sidorin. xazax.hun added a subscriber: cfe-commits. Dynamic casts are handled relatively well by the static analyzer. BaseToDerived casts however are handled conservatively. This can cause some false