Commit 3cb657ad authored by Hugo Moreau's avatar Hugo Moreau

linkresults: index out of range

Using a function call as a function args was failing before.

 * transform/cfg/linkresults.go : Here.
parent 20a41836
Pipeline #26591 passed with stage
in 2 minutes and 36 seconds
......@@ -78,7 +78,9 @@ func (LinkResults) Pre(meta *transform.Meta, v *transform.Visitor) bool {
// outer function.
results = make([]ast.Expr, len(e.Args))
copy(results, e.Args)
results[argIdx] = meta.Get(fr.Results[0])
if len(results) > 0 {
results[argIdx] = meta.Get(fr.Results[0])
}
}
c.Replace(&ast.CallExpr{
Fun: n.Fun,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment