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

x/tools/go/ssa: SrcFuncs is missing top-level anonymous functions #31508

Open
dominikh opened this issue Apr 17, 2019 · 2 comments
Open

x/tools/go/ssa: SrcFuncs is missing top-level anonymous functions #31508

dominikh opened this issue Apr 17, 2019 · 2 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dominikh
Copy link
Member

buildssa walks the AST, collecting all *ast.FuncDecl and all anonymous functions declared inside of those. This misses top-level anonymous functions a la

package pkg

var Fn = func() {}

Such a function is owned by the init function, which has no syntactic representation in the AST.

/cc @ianthehat

@dominikh dominikh added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 17, 2019
@gopherbot gopherbot added this to the Unreleased milestone Apr 17, 2019
@dominikh
Copy link
Member Author

/cc @matloob

@Matts966
Copy link

I tried to get the information of the function variables from ssapkg , but they are named like init$1 , and their names are not modifiable.

Is it possible to deal with assignable functions in SSA form?

Or is there any merit to regard modifiable functions as the same as other SrcFuncs ?

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@adonovan adonovan changed the title x/tools/go/analysis/passes/buildssa: SrcFuncs is missing top-level anonymous functions x/tools/go/ssa: SrcFuncs is missing top-level anonymous functions Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants