Commit 88727e5c authored by Carlos Galindo's avatar Carlos Galindo
Browse files

fix! UsageFinder should visit the argument, not the node

parent f1cafa45
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -39,11 +39,11 @@ public class InterproceduralUsageFinder extends InterproceduralActionFinder<Vari
        ResolvedValueDeclaration resolved = use.getResolvedValueDeclaration();
        Expression argument = extractArgument(use, edge, true);
        ActualIONode actualIn = ActualIONode.createActualIn(edge.getCall(), resolved, argument);
        new VariableVisitor(
        argument.accept(new VariableVisitor(
                (n, exp, name) -> movables.add(new VariableAction.Movable(new VariableAction.Declaration(exp, name, graphNode), actualIn)),
                (n, exp, name, expression) -> movables.add(new VariableAction.Movable(new VariableAction.Definition(exp, name, graphNode, expression), actualIn)),
                (n, exp, name) -> movables.add(new VariableAction.Movable(new VariableAction.Usage(exp, name, graphNode), actualIn))
        ).startVisit(graphNode, VariableVisitor.Action.USE);
        ), VariableVisitor.Action.USE);
        graphNode.addActionsForCall(movables, edge.getCall(), true);
    }