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: function calls within tuples / nested calls #2186

Merged
merged 4 commits into from
Oct 9, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Fix a memory corruption issue when performing a function call inside a tuple or as an argument inside another function call.

How I did it

The issue was happening because each argument/item was parsed without knowledge of the other items. When pushing memory to the stack prior to performing nested call, previous items were not accounted for and so not correctly preserved.

You can see the bug in action by run the test cases I've added against the current master branch.

To fix this, I've expanded the logic for parsing tuples and function call arguments. All nested calls are performed separately, prior to building the tuple/args. This way memory is correctly preserved.

How to verify it

Run the tests. I've added some new cases to verify that the bug no longer exists.

Cute Animal Picture

image

@fubuloubu fubuloubu merged commit 74ba67d into vyperlang:master Oct 9, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-calls-in-tuples branch October 9, 2020 17:34
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