Remove division by zero error message during base invariant#1892
Remove division by zero error message during base invariant#1892
invariant#1892Conversation
Discovered in #1838 (comment). Should be redundant due to #1764.
|
What would you propose instead of (The warning should more likely be an internal analyzer warning, I guess it can sometimes happen that during refinement of something that is actually not reachable we produce some kind of nonsensical value.) |
I haven't yet thought about what exactly this is trying to achieve, but only top-ifying must zero is odd: It's the same kind of strangeness that used to be in the interval division: #1804 (comment). |
|
I think @karoliineh hit this strange behavior also while looking into some |
This is a philosophical question I also raised with @vesalvojdani a few days ago, it seems that the uncertainty it is rooted throughout many decisions about different analyses. To the question of "what do analyzer/src/analyses/baseInvariant.ml Lines 294 to 302 in 55c8b0d Then we also discussed about overflows, and with an overflow, the program does not crash. However, we have these options So, in a sense, |
|
|
|
Yes, |
|
There's no one-size-fits-all answer regarding UB, that's why we have options to configure them separately. But a (definite) signed overflow will not actually crash the program. Depending on the assumptions to make, How all of it relates to the particular issue in this PR is a separate matter. Because this isn't about what happens during normal evaluation of such expression. This is about what's being done after the expression has already been evaluated (to non-bottom I think) and we're not trying to refine the variables in the arguments of such division. |
|
Okay, so here specifically the question is what the backward transfer function should be for But if we have a forward assume none semantics, then definite division by zero should not be asked to refine at all. And if it is a potential division, we should on assume none, be able to simply remove the zero from the denominator and refine the |
Discovered in #1838 (comment). Should be redundant due to #1764.
Especially because this only trigger for must division by zero, not may.
It's strange because it's the only warning/error emitted during base
invariant.TODO