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: Disallow structs in getters for old encoder. #5526

Merged
merged 3 commits into from
Nov 28, 2018
Merged

Conversation

chriseth
Copy link
Contributor

Fixes #5520

* Optimizer: Fix nondeterminism bug related to the boost version and constants representation. The bug only resulted in less optimal but still correct code because the generated routine is always verified to be correct.
* Type Checker: Properly detect different return types when overriding an external interface function with a public contract function.
* Type Checker: Disallow struct return types for getters of public state variables unless the new ABI encoder is active.
Copy link
Member

Choose a reason for hiding this comment

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

The code seems to allow simple structs though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, need to think whether this can be rephrased, but it's hard. If the resulting type is only a struct, then it is broken up and the getter actually returns multiple values instead of a struct.

libsolidity/analysis/TypeChecker.cpp Outdated Show resolved Hide resolved
libsolidity/analysis/TypeChecker.cpp Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 28, 2018

Codecov Report

Merging #5526 into develop will decrease coverage by 0.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5526      +/-   ##
===========================================
- Coverage    88.19%   88.18%   -0.02%     
===========================================
  Files          319      319              
  Lines        31650    31659       +9     
  Branches      3792     3797       +5     
===========================================
+ Hits         27914    27917       +3     
  Misses        2459     2459              
- Partials      1277     1283       +6
Flag Coverage Δ
#all 88.18% <69.23%> (-0.02%) ⬇️
#syntax 28.97% <69.23%> (ø) ⬆️

@chriseth
Copy link
Contributor Author

Updated.

@chriseth
Copy link
Contributor Author

I really, really don't understand codecov...

@chriseth chriseth merged commit b4086ac into develop Nov 28, 2018
@axic axic deleted the fixGetterNewCoder branch January 22, 2019 02:57
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