Charusso marked 4 inline comments as done. Charusso added a comment. This is a little-bit WIP as the symbol conjuring is very naive.
================ Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:111 + QualType Ty = CE->getCallReturnType(C.getASTContext()); + V = C.getSValBuilder().makeTruthVal(true, Ty); + } ---------------- That is a very lame way to conjure a symbol, but with a cool wrapper I believe this would be okay. Do we have a better way to create a non-null symbol? ================ Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:718 + assert(ThisVal.isUnknownOrUndef() || ThisVal.getAs<Loc>() || + ThisVal.getAs<nonloc::ConcreteInt>()->getValue().getExtValue() == 1); return ThisVal; ---------------- This is the only necessary addition to make it usable. ================ Comment at: clang/test/Analysis/cast-value.cpp:113 + // logic-warning@-1 {{TRUE}} + // logic-warning@-2 {{FALSE}} + ---------------- I am not sure what is going on here, ================ Comment at: clang/test/Analysis/cast-value.cpp:131 + // logic-warning@-1 {{TRUE}} + // logic-warning@-2 {{FALSE}} + ---------------- and here. ================ Comment at: clang/test/Analysis/cast-value.cpp:193 + // expected-warning@-2 {{Division by zero}} + // logic-warning@-3 {{Division by zero}} +} ---------------- Known-value printing fails, but at least it is working well. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65889/new/ https://reviews.llvm.org/D65889 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits