Skip to content

Conversation

jakerockland
Copy link
Contributor

- What I did

Related somewhat to conversation on #1082. Catch at compile-time if trying to convert bytes array of max length greater than 32 to int128 type.

- How I did it

Updated convert.py to do a check on max length when converting from bytes type (my understanding as to why SizeLimits.in_bounds() doesn't work for bytes type is that it is being passed by reference not by value?).

Added relevant tests to test_int128.py

- How to verify it

make test

- Description for the changelog

Patch to prevent conversion from bytes array greater than 32 bytes to int128.

- Cute Animal Picture

image

in_node = args[0]
typ, len = get_type(in_node)
if typ in ('uint256', 'bytes32'):
input_type, len = get_type(in_node)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just change len to underscore and we can merge ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jacqueswww done! 🙌 😅

@jacqueswww jacqueswww merged commit b532e6e into vyperlang:master Nov 27, 2018
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.

2 participants