[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307604: [analyzer] Start fixing modeling of bool based types (authored by alexshap). Changed prior to commit: https://reviews.llvm.org/D35041?vs=105597=105947#toc Repository: rL LLVM

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-10 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added inline comments. This revision is now accepted and ready to land. Comment at: test/Analysis/enum.cpp:50 + +typedef __INTPTR_TYPE__ intptr_t; +bool testNoCrashOnSwitchEnumBoolConstantCastedFromNullptr() { Nice! Will use in my

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-10 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D35041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-07 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105597. Repository: rL LLVM https://reviews.llvm.org/D35041 Files: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp test/Analysis/enum.cpp Index: test/Analysis/enum.cpp

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105562. alexshap added a comment. Add a test where SimpleSValBuilder::evalCastFromNonLoc is called and we hit the line unsigned castSize = Context.getIntWidth(castTy); Repository: rL LLVM https://reviews.llvm.org/D35041 Files:

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap updated this revision to Diff 105524. alexshap added a comment. Add a test where evalCastFromLoc is called and the line unsigned BitWidth = Context.getIntWidth(castTy); is hit. I am planning to update this patch once again with a proper test where the path inside evalCastFromNonLoc is

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. >> In https://reviews.llvm.org/D35041#801073, @alexshap wrote: >> evalCastFromNonLoc is actually called there (and that's how i ran into this >> issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' >> inside switch > > Yeah, but the NonLoc

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D35041#801073, @alexshap wrote: > evalCastFromNonLoc is actually called there (and that's how i ran into this > issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' > inside switch Yeah, but the `NonLoc` that's being

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
alexshap added a comment. thanks, 1. evalCastFromNonLoc is actually called there (and that's how i ran into this issue) because of (a bit unexpected to me) ImplicitCastExpr 'LValueToRValue' inside switch: F3629685: Screen Shot 2017-07-06 at 11.01.39 AM.png

[PATCH] D35041: [analyzer] Fix modeling of bool based types

2017-07-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Thanks, these are very helpful. Sending changes in smaller chunks is great even if you already have one large chunk perfectly working :) The test covers only the `BasicValueFactory`-related part of your patch; the Loc-related changes are still to be tested. I suspect the