-
Notifications
You must be signed in to change notification settings - Fork 263
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
Fix a soundness issue that could be triggered by calling ensures fres… #5248
Conversation
…h in the post-condition of a constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful! You totally crushed this soundness issue!
} | ||
// for class constructors, the receiver is encoded as an output parameter | ||
Bpl.Formal thVar = new Bpl.Formal(tok, new Bpl.TypedIdent(tok, "this", TrType(receiverType), wh), !(m is Constructor && kind != MethodTranslationKind.SpecWellformedness)); | ||
Bpl.Formal thVar = new Bpl.Formal(tok, new Bpl.TypedIdent(tok, "this", TrType(receiverType), wh), | ||
m is not Constructor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, I see now the soundness issue fix Rustan was talking about. Well done spotting it.
This PR does not completely fix the problem identified by #4700. The PR moves the My comment on #4700 said to remove the In my comments on #5136, I said that the entire So, the full fix of both #4700 and #5136 is to:
|
@RustanLeino could you provide a failing test-case, that highlights the changes you describe are still necessary? I trust that your suggestions are correct, but without a test-case I can not validate that, and I'm not sure how to reverse engineer a test-case from what you're describing. |
Fixes #4700
Description
Fix a soundness issue that could be triggered by calling ensures fresh in the post-condition of a constructor.
How has this been tested?
Added a littish test
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.