-
Notifications
You must be signed in to change notification settings - Fork 375
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: don't pass value types by reference #1263
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1263 +/- ##
==========================================
+ Coverage 55.70% 55.71% +0.01%
==========================================
Files 421 421
Lines 65555 65562 +7
==========================================
+ Hits 36515 36528 +13
Misses 26177 26177
+ Partials 2863 2857 -6
☔ View full report in Codecov by Sentry. |
The solution you provide is correct to me, and I approve it 👏 . Regarding the test case, it would be better if the code was compatible with pure Go, which is not at the moment due to the use of println which is more limited in pure Go. It is certainly fixable easily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 💯
Thank you for the fix 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "weird printing" of println is present in a lot of filetests ( you're welcome to create an issue :) |
The fix works well. Since the fix is in op_call during VM execution and involves large number copying, maybe @jaekwon can help identify if it's the best place for the fix and any other related areas that need attention. |
I think it's the right place. op_eval.go for *CallExpr which invokes OpPrecall doesn't copy, it just evaluates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Addresses gnolang#1096 These changes ensure that passing non-primitive value types to a function do not result in the modification of the original value, even if the value type is represented as a pointer inside the VM.
Addresses gnolang#1096 These changes ensure that passing non-primitive value types to a function do not result in the modification of the original value, even if the value type is represented as a pointer inside the VM.
Addresses #1096
These changes ensure that passing non-primitive value types to a function do not result in the modification of the original value, even if the value type is represented as a pointer inside the VM.