Skip to content

jsgen: a pointer function cannot be called directly (fix #24417) #24459

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

Conversation

gchumillas
Copy link
Contributor

Fixes #24417

Copy link

Connected to Huly®: V_0.6-22829

Comment on lines +14 to +16
// calls a pointer function
cb3 := &cb1
assert cb3() == hello
Copy link
Member

@spytheman spytheman May 11, 2025

Choose a reason for hiding this comment

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

A function is already a pointer to its start/body.
Why should this work (taking the address of a pointer, and then calling the function through that double pointer)?

Copy link
Member

@spytheman spytheman May 21, 2025

Choose a reason for hiding this comment

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

It also does not work with the C backend, leading to a cgen error.

@gchumillas
Copy link
Contributor Author

This PR adds an unnecessary feature.

@gchumillas gchumillas closed this May 21, 2025
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.

jsgen: a pointer function cannot be called directly
2 participants