Open
Description
When we perform escape analysis on a call site to a function that was previously analyzed, the analysis is done context sensitively. We take note of the arguments and how they flow to results, according to the callee's previous analysis.
But within a batch of mutually recursive functions, we handle calls by directly flowing arguments to other functions and directly flowing results to where they're used. This has a consequence of making the analysis context-insensitive.
For example, in the package below, when inlining is disabled, we report that p
leaks to the heap, rather than to the result of f
. This imprecision happens because we see p
flows to the result of f
, and then flows to the result of g
(thus escaping).
package p
func f(p *int) *int {
g()
return p
}
func g() *int {
return f(new(int))
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo