This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
Give diagnostic in default mode when a root function has call with false precondition and unknown path cond #1184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When an analysis root calls a function with precondition that is know to be false, give a diagnostic about it even when in default mode and with uncertainty about whether the call will be reached or not.
In the test case derived from the repro in issue #1176, the call looks like it is deterministically reachable, but the implementation of
vec![1, 2, 3]
is sufficiently complicated that the analysis is unable to conclude that no path inside it will crash, which gives it a post condition that is not known to be true, which leaks into the path condition for the call, which ends up asfalse join true
and make this analysis uncertain that the path condition is feasible. The code dealing with false preconditions did not to issue diagnostics in root functions unless the path condition is known to be true. It now issues a diagnostic unless the path condition is known to be false.Fixes #1176
Type of change
How Has This Been Tested?
./validate.sh with additional test case