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

Copy values on return #355

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Copy values on return #355

merged 1 commit into from
Aug 28, 2020

Conversation

turbolent
Copy link
Member

I incorrectly removed the copying of return values in a previous PR (https://github.com/onflow/cadence/pull/288/files#diff-a8c2ab8c721531fd42f8f5ecbad5ca28L1092-R1092), but as @joshuahannan pointed out, call-sites could directly access the returned value without assigning it e.g to a variable (which copies), allowing modification of the returned value.

@joshuahannan
Copy link
Member

Thanks to @alxocity for pointing this out!

@turbolent turbolent merged commit a2e73bc into master Aug 28, 2020
@turbolent turbolent deleted the bastian/copy-on-return branch August 28, 2020 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants