Address review comments

This commit is contained in:
Tom Hvitved
2021-06-04 14:29:53 +02:00
parent cc02c95092
commit 42202402a4
5 changed files with 15 additions and 17 deletions

View File

@@ -712,8 +712,8 @@ module Private {
exists(SourceOrSinkElement e |
sourceElement(e, output, kind) and
if outputNeedsReference(specLast(output))
then viableCallable(ref.asCall()) = any(InterpretNode n | n.asElement() = e).asCallable()
else ref.asElement() = e
then e = ref.getCallTarget()
else e = ref.asElement()
)
}
@@ -721,8 +721,8 @@ module Private {
exists(SourceOrSinkElement e |
sinkElement(e, input, kind) and
if inputNeedsReference(specLast(input))
then viableCallable(ref.asCall()) = any(InterpretNode n | n.asElement() = e).asCallable()
else ref.asElement() = e
then e = ref.getCallTarget()
else e = ref.asElement()
)
}

View File

@@ -136,6 +136,9 @@ class InterpretNode extends TInterpretNode {
/** Gets the callable that this node corresponds to, if any. */
DataFlowCallable asCallable() { result = this.asElement() }
/** Gets the target of this call, if any. */
Callable getCallTarget() { result = this.asCall().getARuntimeTarget() }
/** Gets a textual representation of this node. */
string toString() {
result = this.asElement().toString()