Skip to content

[Codegen] Do not perform cleanup on unsigned integers when loading from calldata. #5368

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

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

chriseth
Copy link
Contributor

@chriseth chriseth commented Nov 7, 2018

Fixes #5319

@ethereum ethereum deleted a comment from stackenbotten Nov 8, 2018
@stackenbotten
Copy link

There was an error during the CI process:

test3

Please check that your changes are working as intended.

@chriseth chriseth changed the title Do not perform cleanup on unsigned integers when loading from calldata. [DO NOT MERGE] Do not perform cleanup on unsigned integers when loading from calldata. Nov 12, 2018
@codecov
Copy link

codecov bot commented Nov 14, 2018

Codecov Report

Merging #5368 into develop will decrease coverage by 1.1%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5368      +/-   ##
===========================================
- Coverage    29.05%   27.94%   -1.11%     
===========================================
  Files          308      323      +15     
  Lines        31012    32357    +1345     
  Branches      3744     3872     +128     
===========================================
+ Hits          9009     9041      +32     
- Misses       21321    22627    +1306     
- Partials       682      689       +7
Flag Coverage Δ
#syntax 27.94% <0%> (-1.11%) ⬇️

@chriseth chriseth changed the title [DO NOT MERGE] Do not perform cleanup on unsigned integers when loading from calldata. [Codegen] Do not perform cleanup on unsigned integers when loading from calldata. Nov 14, 2018
}
else if (IntegerType const* intType = dynamic_cast<IntegerType const*>(&_type))
if (!intType->isSigned())
cleanupNeeded = false;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this only be a special case for uint256?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because we shift right by the appropriate amount. The use-case in mind actually uses uint32 (the 4 byte function selector).

Copy link
Member

Choose a reason for hiding this comment

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

Right, this is in the non-32byte branch.

Ah, forgot it is BE and not LE. The code looks good.

axic
axic previously approved these changes Nov 14, 2018
@axic
Copy link
Member

axic commented Nov 14, 2018

The docs and archlinux failure is unrelated.

@axic axic merged commit 92ebf66 into develop Nov 14, 2018
@axic axic deleted the noCleanupUnsigned branch November 14, 2018 21:15
@fulldecent
Copy link
Contributor

Thank you, looks great!

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.

4 participants