Skip to content
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 less compare for address and bytes32 #498

Merged
merged 3 commits into from
Jan 7, 2020
Merged

Conversation

kjx98
Copy link
Contributor

@kjx98 kjx98 commented Jan 6, 2020

"load64be(&a.bytes[8]) == load64be(&b.bytes[8])" requires "load64be(&a.bytes[0]) == load64be(&b.bytes[0]" as well, check if load64be(&a.bytes[0]) > load64be(&b.bytes[0] and "load64be(&a.bytes[8]) == load64be(&b.bytes[8])"

@codecov-io
Copy link

codecov-io commented Jan 6, 2020

Codecov Report

Merging #498 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
+ Coverage   91.93%   91.97%   +0.03%     
==========================================
  Files          20       20              
  Lines        3076     3089      +13     
==========================================
+ Hits         2828     2841      +13     
  Misses        248      248

@axic axic requested a review from chfast January 6, 2020 11:09
@chfast
Copy link
Member

chfast commented Jan 6, 2020

Do you have unit tests for these cases?

@kjx98
Copy link
Contributor Author

kjx98 commented Jan 7, 2020

add unit test to test/unittests/cpp_test.cpp
z_max stands 0x00000000 00000000 (64 bits) leading 0 for address/bytes32
max_z tailing with 64 bits 0

Copy link
Member

@chfast chfast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

@chfast chfast merged commit eb64e60 into ethereum:master Jan 7, 2020
@kjx98 kjx98 deleted the less_cmp branch January 8, 2020 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants