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

cgen: fix several issues with autofree(fix #20635) #20659

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Jan 26, 2024

  1. Fixed -autofree with net.len() Unknown address family ~/v/vlib/net/address.c.v:111 #20635
  2. Add tests.
  • Fixed early free when the return value has options/result
  • Fixed CallExpr, UnsafeExpr, MatchExpr... And so on expression lost the clone problem
  • Added special tests

@shove70 shove70 marked this pull request as draft January 26, 2024 04:41
@@ -0,0 +1,58 @@
// vtest vflags: -autofree
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This // vtest vflags: -autofree is currently recognized only for .vv programs under vlib/v/gen/c/testdata/. The logic for it, is implemented in vlib/v/gen/c/coutput_test.v .

Autofree programs however, are usually tested by vlib/v/slow_tests/valgrind/valgrind_test.v , and are located under vlib/v/slow_tests/valgrind .

I think you should move that program there too, just rename fn test_main() { to fn main() {.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for telling me. ❤️
this is a complicated issue, I still need to fix it, finally I will move it to vlib/v/slow_tests/valgrind

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on it 🙇🏻‍♂️ .

@esquerbatua esquerbatua added the Needs Rebase The code of the PR must be rebased over current master before it can be approved. label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Rebase The code of the PR must be rebased over current master before it can be approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-autofree with net.len() Unknown address family ~/v/vlib/net/address.c.v:111
3 participants