summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/tools
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-21 18:24:29 +0100
committer zaaarf <zaaarf@proton.me>2023-03-21 18:24:29 +0100
commitff47129cf3ac12817bf4ca9af8753592298f03e4 (patch)
tree49fbdf8b1ca388747a2893c25176c69186431e75 /src/main/java/ftbsc/lll/tools
parent884cefead9e4fede7243650afc4f22f08f8e5090 (diff)
feat: restored flat descriptors, implemented primitive proxies
Diffstat (limited to 'src/main/java/ftbsc/lll/tools')
-rw-r--r--src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java2
-rw-r--r--src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java2
-rw-r--r--src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java23
3 files changed, 25 insertions, 2 deletions
diff --git a/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java b/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java
index 479e651..068ade0 100644
--- a/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java
+++ b/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java
@@ -17,6 +17,6 @@ public class FieldProxyInsnNode extends FieldInsnNode {
* @param f a {@link FieldProxy} representing the field to call
*/
public FieldProxyInsnNode(int opcode, FieldProxy f) {
- super(opcode, f.parent.internalName, f.name, f.type.getDescriptor());
+ super(opcode, f.parent.internalName, f.name, f.descriptor);
}
}
diff --git a/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java b/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java
index 4fb3b89..01549a8 100644
--- a/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java
+++ b/src/main/java/ftbsc/lll/tools/nodes/MethodProxyInsnNode.java
@@ -18,6 +18,6 @@ public class MethodProxyInsnNode extends MethodInsnNode {
* @param m a {@link MethodProxy} representing the method to call
*/
public MethodProxyInsnNode(int opcode, MethodProxy m) {
- super(opcode, m.parent.internalName, m.name, m.type.getDescriptor());
+ super(opcode, m.parent.internalName, m.name, m.descriptor);
}
}
diff --git a/src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java b/src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java
new file mode 100644
index 0000000..e5b5f2a
--- /dev/null
+++ b/src/main/java/ftbsc/lll/tools/nodes/TypeProxyInsnNode.java
@@ -0,0 +1,23 @@
+package ftbsc.lll.tools.nodes;
+
+import ftbsc.lll.proxies.TypeProxy;
+import org.objectweb.asm.tree.TypeInsnNode;
+
+/**
+ * Overrides the {@link TypeInsnNode} to add a constructor
+ * taking in a {@link TypeProxy}.
+ * @since 0.4.0
+ */
+public class TypeProxyInsnNode extends TypeInsnNode {
+ /**
+ * Constructs a new {@link TypeInsnNode} starting from a
+ * {@link TypeProxy}. The user should ensure that the TypeInsnNode
+ * represents a declared type before calling this.
+ * @param opcode the opcode, must be one of NEW, ANEWARRAY,
+ * CHECKCAST or INSTANCEOF
+ * @param t a {@link TypeProxy} representing the type to call
+ */
+ public TypeProxyInsnNode(int opcode, TypeProxy t) {
+ super(opcode, t.internalName);
+ }
+}