cmd/compile: recursive functions are escape analyzed context insensitively #62501
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
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 off
. This imprecision happens because we seep
flows to the result off
, and then flows to the result ofg
(thus escaping).The text was updated successfully, but these errors were encountered: