-
Notifications
You must be signed in to change notification settings - Fork 109
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
[Prusti internal error] Consistency error: No matching local variable _2 found with type Ref, instead found Int. #925
Comments
I did some debugging to see if I could find out more. In the snapshot patcher prusti-dev/prusti-viper/src/encoder/snapshot/patcher.rs Lines 134 to 154 in aaddd28
indeed
While at this point I believe it should already be passed as a:
Im not sure whether the snapshot patcher is the best place to fix this, I have a feeling that an earlier substitution already went off the rails and its best fixed there, but I haven't been able to pin-point that one yet. |
Just wondering: does this occur under #899? I changed some var substitution stuff there. |
Indeed the same error happens on the branch for #899 (also on the master branch). |
I suspect that the cause of the problem can be found somewhere in the logic of the The MIR for
|
I found some code that hints at a similar fix as would be applied to the problem in this issue: prusti-dev/prusti-viper/src/encoder/mir/pure/pure_functions/encoder.rs Lines 142 to 167 in 6a9291b
It looks like it is checked already here, but maybe it's missing a corner case somewhere. |
I think I've fixed it locally, I'll open a PR once the test suite passes :) |
Fixed in #928. Thanks! |
fixed another consistency error similar to #925
The following Rust program, which is a slight variation on #815, triggers a consistency error in Prusti/Viper:
The error message is:
This happens for both Viper programs for
fn main
andfn test
. In both cases, the relevant Viper code is:Something seems to be going wrong during the encoding step, where
_2
is mistaken for aRef
instead of anInt
as declared in the function signature.The text was updated successfully, but these errors were encountered: