You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason this ineffective assignment is not recognized is actually not due to the defer but to the &err. Whenever the tool sees &x, it says "x escapes" and gives up on tracking it, because it's a more complicated problem to track where pointers flow through a program. As far as the tool is concerned, decorateErr(&err) (as seen from the outside) might possibly use *err instead of just assigning to it.
Until the tool is completely rewritten to use a full pointer analysis (if ever), it's beyond its scope to recognize this case.
The reason this ineffective assignment is not recognized is actually not due to the defer but to the &err. Whenever the tool sees &x, it says "x escapes" and gives up on tracking it, because it's a more complicated problem to track where pointers flow through a program. As far as the tool is concerned, decorateErr(&err) (as seen from the outside) might possibly use *err instead of just assigning to it.
Until the tool is completely rewritten to use a full pointer analysis (if ever), it's beyond its scope to recognize this case.
The ineffective assignment is recognized if I remove "defer decorateErr(&err)".
The text was updated successfully, but these errors were encountered: