-
Notifications
You must be signed in to change notification settings - Fork 256
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
Crash when running -testContracts
on refinement of abstract module
#4845
Comments
-testContracts
on abstract module-testContracts
on refinement of abstract module
Running with Dafny 4.1.0 results in a different error:
Dafny 4.2.0 gives the same error as 4.3.0. |
Some more detail. This error comes up when processing the wrapper around |
I've narrowed this down to a smaller example.
If this code is in
|
### Description Previously, compiling an abstract module with an `{:extern}` method using `--test-assumptions Externs` would cause an assertion failure. This was due to interleaving between the contract checking wrapper generator and the module refinement rewriter. This PR fixes the problem by generating contract checking wrappers for the whole program after resolution is finished, rather than as each module finishes resolution. Fixes #4845 ### How has this been tested? Tested by `contract-wrappers/RefineContract.dfy`. By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Dafny version
4.3.0
Code to produce this issue
https://github.com/aws/aws-cryptographic-material-providers-library-java/blob/main/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy
Command to run and resulting output
What happened?
It should have successfully generated target code without throwing an exception.
The exception comes from trying to dereference
callee
, asserted to be non-null here(I used a release build above, so it's a later null dereference that fails. With a debug build, the assertion fails.)
The crash is happening on wrapper code generated by the implementation of
testContracts
, but I've done some debugging of the generation, and theMethod
property is set to a non-null value there when running on thins example. So somewhere later, perhaps during cloning, property becomes null.What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: