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-#2183: Incorrect output while passing multi-dimensional array as argument #2184

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

saikat041
Copy link
Contributor

What I did

Fixed: #2183

How I did it

In this line it is assumed that size of each subtype of a array/struct is 32, which is wrong:

staticarray_offset += 32 * (count - 1)

So I replaced the above line with this.

staticarray_offset += 32 * (get_size_of_type(typ) - 1)

And since the variable count is not needed anymore we can avoid its calculation here:

if isinstance(typ, ListType):

@codecov-io
Copy link

codecov-io commented Oct 8, 2020

Codecov Report

Merging #2184 into master will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2184      +/-   ##
==========================================
- Coverage   85.32%   85.22%   -0.10%     
==========================================
  Files          83       79       -4     
  Lines        8403     8219     -184     
  Branches     2032     2005      -27     
==========================================
- Hits         7170     7005     -165     
+ Misses        731      714      -17     
+ Partials      502      500       -2     
Impacted Files Coverage Δ
vyper/parser/parser_utils.py 80.49% <100.00%> (-0.16%) ⬇️
vyper/typing.py
vyper/__main__.py
vyper/opcodes.py
vyper/exceptions.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5115867...4a9656f. Read the comment docs.

Copy link
Contributor

@iamdefinitelyahuman iamdefinitelyahuman left a comment

Choose a reason for hiding this comment

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

Good catch!

@fubuloubu fubuloubu merged commit 0be02b7 into vyperlang:master Oct 8, 2020
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.

Incorrect output while passing multi-dimensional array as argument
4 participants