Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: unused variable escapes to the heap #27188
What version of Go are you using (
changed the title from
cmd/compile: unused variable escapes to the heap
Aug 24, 2018
The algorithm we use is not that clever and just tracks flow by variable name.
Since there's an easy workaround and big blockers for the proper fix, I would not commit to fixing this in 1.12.
I think (but now I am a little bit less sure, but lack the time right now to be more sure):
One possible benefit, from talking to a guy at GopherCon (@cixel) who's interested in doing instrumentation for taint detection/analysis, is doing dataflow-informed instrumentation. Idea is that we'd transform to SSA, do whatever instrumentation we want (that might, in some cases, have effects on escape analysis -- and might also have effects on stack frames), then run escape analysis etc.
This is still a little hand-wavy. He's looking the code for tsan and msan, and modifying things at the AST level, but having the ability to do flow analysis would be helpful (I wonder if it might not also help tsan and msan)