-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[SMTChecker] Fix comparison of CHCVerificationTarget
for proper std::set
ordering
#16147
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
base: develop
Are you sure you want to change the base?
Conversation
Thank you for your contribution to the Solidity compiler! A team member will follow up shortly. If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother. If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix. |
SafeTargetsCompare
operator for proper std::set
ordering
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.
LGMT!
Thanks for finding this out!
I am fine with merging this, but I will look into it further, because CHCVerificationTarget
also provides operator<
, which, however, works completely differently, which is weird.
I don't think we need both.
It looks like the |
Did i make changes correctly? |
Just two general notes:
|
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.
Yes, this is what I meant.
I've just noticed that there was an extra space, can you fix that as well?
Also, can you rebase your branch? I believe that should fix the external tests in CI.
My understanding is that this only affects the order of verification targets proved safe.
I agree, please update the description. |
@cameel, I have checked the codebase and it turns out that the problematic piece of code (one fixed in this PR) is indeed never reached at the moment. In current codebase the comparison is only used in Thus currently, the bug was never triggered, but it was indeed a hidden bug in the implementation. My conclusion is that other than a unit test, we are not able to test the changed place in the code, and we don't have unit tests, right? |
Co-authored-by: blishko <[email protected]>
updated description |
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.
Thanks!
SafeTargetsCompare
operator for proper std::set
orderingCHCVerificationTarget
for proper std::set
ordering
What was changed
SafeTargetsCompare
struct toCHCVerificationTarget::operator<
SafeTargetsCompare
struct completely==
was used instead of<
in the comparison operatorstd::set<CHCVerificationTarget, SafeTargetsCompare>
to use defaultstd::set<CHCVerificationTarget>