Skip to content

Do not add signature to memory for private function calls#2058

Merged
iamdefinitelyahuman merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:fix-internal-call-sig
Jun 27, 2020
Merged

Do not add signature to memory for private function calls#2058
iamdefinitelyahuman merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:fix-internal-call-sig

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
Contributor

What I did

Do not write a signature to memory when preparing args for a private function call. Fixes #1695

How I did it

In vyper/parser/parser_utils.py::pack_arguments, replaced the return_placeholder kwarg with is_external_call. When False, the signature is stored in memory.

I had to adjust some memory offsets to make this work, but I think the resulting code is a bit cleaner.

How to verify it

Run the tests. I didn't add any cases, but I did confirm that we have sufficient coverage around this functionality.

Cute Animal Picture

image

@iamdefinitelyahuman iamdefinitelyahuman merged commit 12df3bc into vyperlang:master Jun 27, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-internal-call-sig branch June 27, 2020 20:35
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.

Private function calls with arguments needlessly store a function selector in memory

2 participants