-
Notifications
You must be signed in to change notification settings - Fork 6.2k
[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? |
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
Well, we do have boost tests and do sometimes use unit tests for stuff we cannot reach with code snippets, but I agree - this one is not a case where I'd add one. It does not seem worth the effort. I pointed it out as a general precaution to the contributor, but if you checked the code and think it's fine, I trust your judgement here. BTW, I disabled automerge because it got stuck and also because the commits need squashing first. This is a single change, it does not need 4 commits. Especially there should be no merge commits in there, those make history just unreadable. |
I agree. @radik878 can you squash the commits? |
Tough to say, 'Unable to squash. Squashing replays all commits up to the last one required for the squash. A merge commit cannot exist among those commits.' |
You basically need to remove the merge commit, then you will be able to squash your three commits. |
I tried but i don't know. Github desktop doesn't let me remove merge commit |
Let me see if I can do something on my side. It's a good idea to learn git directly (not relying solely on GitHub), it's a very useful skill! |
It's really a good idea, I am convinced of this once again. |
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>