-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static analysis cleanup and open issues #24
Conversation
static_cast<bool>("string lit") evaluates to true. The assert is supposed to always trigger, thus assert(false && "string lit").
Signed-off-by: Nikolaj Bjorner <[email protected]>
52e29de
to
30eb461
Compare
Thanks for the patches, those all look good to me. I've moved some of the other issues into separate issues to be looked at later. |
@daniel-j-h if it's not too much trouble, could I get you to sign a CLA before we merge this? |
@wintersteiger signed. |
Signed-off-by: Nikolaj Bjorner <[email protected]>
Signed-off-by: Nikolaj Bjorner <[email protected]>
Sorry for the premature closure of this. I'm now merging it into master. |
Hi @daniel-j-h, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Merged into master as of 6749c19 |
* fix bound bug Signed-off-by: Nikolaj Bjorner <[email protected]> * fix bounds check Signed-off-by: Nikolaj Bjorner <[email protected]> * for solver call in final check Signed-off-by: Nikolaj Bjorner <[email protected]> * update logging code Signed-off-by: Nikolaj Bjorner <[email protected]> * fix compiler error, tabs Signed-off-by: Nikolaj Bjorner <[email protected]> * using variable bounds an term facility Signed-off-by: Nikolaj Bjorner <[email protected]>
I used LLVM's (3.6) static analyzer and clang's (3.6) Weverything flag in order to check the source.
There are minor issues I could fix myself, e.g. undefined behavior when doing 1 << 31.
(Interestingly this is not UB anymore in C++14, see: http://stackoverflow.com/q/26331035)
This increment looks suspicious, as it is dead code:
z3/src/ast/used_vars.cpp
Lines 106 to 112 in d01c349
Clarify operator precedence: && trumps ||: Is this correct?
z3/src/ast/fpa/fpa2bv_converter.cpp
Lines 1883 to 1884 in d01c349
Undefined behavior in reinterpret_cast's, one example is this, but there are more:
z3/src/util/hwf.cpp
Line 161 in d01c349
-Wundefined-reinterpret-cast finds those.
This loop is executed only a single time. Always. Is this correct?
z3/src/util/prime_generator.cpp
Line 70 in d01c349
Note: based on the comment by wintersteiger in #11 this pull request is against the unstable branch.
Would you please be so kind and take a look at those issues -- maybe if you have the time do a static analysis and Weverything build yourself and check the left over warnings.
Thanks,
Daniel