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

Class NewArray

src/main/java/pascal/taie/ir/exp/NewArray.java:32–66  ·  view source on GitHub ↗

Representation of new array expression, e.g., new T[..].

Source from the content-addressed store, hash-verified

30 * Representation of new array expression, e.g., new T[..].
31 */
32public class NewArray implements NewExp {
33
34 private final ArrayType type;
35
36 private final Var length;
37
38 public NewArray(ArrayType type, Var length) {
39 this.type = type;
40 this.length = length;
41 }
42
43 @Override
44 public ArrayType getType() {
45 return type;
46 }
47
48 public Var getLength() {
49 return length;
50 }
51
52 @Override
53 public Set<RValue> getUses() {
54 return Set.of(length);
55 }
56
57 @Override
58 public <T> T accept(ExpVisitor<T> visitor) {
59 return visitor.visit(this);
60 }
61
62 @Override
63 public String toString() {
64 return String.format("newarray %s[%s]", type.elementType(), length);
65 }
66}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected