[PATCH] D13126: New static analyzer checker for loss of sign/precision

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 17 08:35:04 PDT 2016


NoQ accepted this revision.
NoQ added a reviewer: NoQ.
NoQ added a comment.
This revision is now accepted and ready to land.

Looks good!


================
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:67
@@ +66,3 @@
+  const Stmt *Parent = PM.getParent(Cast);
+  if (!Parent)
+    return;
----------------
danielmarjamaki wrote:
> I get assertion failure then when running this test:  Analysis/misc-ps-region-store.cpp
> 
> Command that fails:
> 
> /home/danielm/llvm/build/./bin/clang -cc1 -internal-isystem /home/danielm/llvm/build/bin/../lib/clang/4.0.0/include -nostdsysteminc -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks /home/danielm/llvm/tools/clang/test/Analysis/misc-ps-region-store.cpp -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare
> 
Aha! Had a look: the parent is a `CXXCtorInitializer`, which is outside this function's body, and hence not covered with the current `StackFrameContext`'s `ParentMap`. So you're losing positives in constructor initializers, and fixing it would take some code.


https://reviews.llvm.org/D13126





More information about the cfe-commits mailing list