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&id=67136#toc
Repository:
rL LLVM
https://reviews
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
http://lists.llvm.org/cgi-bin/mailman/lis
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
lib/StaticAnalyzer/Core/CallEvent
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, Failed);
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 //no
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// consta
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 mak
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
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