Skip to content

Fix: function calls within tuples / nested calls#2186

Merged
fubuloubu merged 4 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-calls-in-tuples
Oct 9, 2020
Merged

Fix: function calls within tuples / nested calls#2186
fubuloubu merged 4 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-calls-in-tuples

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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