MCPcopy Create free account
hub / github.com/LFYSec/MScan / Invoke

Class Invoke

src/main/java/pascal/taie/ir/stmt/Invoke.java:39–164  ·  view source on GitHub ↗

Representation of invocation statement, e.g., r = o.m(...) or o.m(...).

Source from the content-addressed store, hash-verified

37 * Representation of invocation statement, e.g., r = o.m(...) or o.m(...).
38 */
39public class Invoke extends DefinitionStmt<Var, InvokeExp>
40 implements Comparable<Invoke> {
41
42 /**
43 * The variable receiving the result of the invocation. This field
44 * is null if no variable receives the invocation result, e.g., o.m(...).
45 */
46 @Nullable
47 private final Var result;
48
49 /**
50 * The invocation expression.
51 */
52 private final InvokeExp invokeExp;
53
54 /**
55 * The method containing this statement.
56 */
57 private final JMethod container;
58
59 public Invoke(JMethod container, InvokeExp invokeExp, @Nullable Var result) {
60 this.invokeExp = invokeExp;
61 this.result = result;
62 if (invokeExp instanceof InvokeInstanceExp) {
63 Var base = ((InvokeInstanceExp) invokeExp).getBase();
64 base.addInvoke(this);
65 }
66 this.container = container;
67 }
68
69 public Invoke(JMethod container, InvokeExp invokeExp) {
70 this(container, invokeExp, null);
71 }
72
73 @Override
74 @Nullable
75 public Var getLValue() {
76 return result;
77 }
78
79 @Nullable
80 public Var getResult() {
81 return result;
82 }
83
84 @Override
85 public InvokeExp getRValue() {
86 return invokeExp;
87 }
88
89 /**
90 * @return the invocation expression of this invoke.
91 * @see InvokeExp
92 */
93 public InvokeExp getInvokeExp() {
94 return invokeExp;
95 }
96

Callers

nothing calls this directly

Calls 4

comparingMethod · 0.80
toStringMethod · 0.65
getContainerMethod · 0.65
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected