Fixed an undocumented access_flag bug

This commit is contained in:
SuspiciousActivity committed 2018-06-22 15:09:43 +02:00
1 parent 7b95716a5c
commit 4624d64f0f
2 files changed
+17 -6

No files matched your search

+16 -5
View File
@@ -170,6 +170,9 @@ public class Assembler {
if (split.length > 2) {
String cons = consolidateStrings(split, 0, split.length - 2);
if (cons.startsWith("0x")) {
access = Integer.parseInt(cons.substring(2), 16);
} else {
if (cons.contains("public")) {
access ^= ClassUtil.ACC_PUBLIC;
}
@@ -219,6 +222,7 @@ public class Assembler {
access ^= ClassUtil.ACC_MANDATED;
}
}
}
FieldNode node = new FieldNode(access, name, desc, signature, value);
if (!annotationsForNext.isEmpty()) {
if (node.visibleAnnotations == null) {
@@ -1184,8 +1188,12 @@ public class Assembler {
LinkedHashMap<Integer, LabelNode> labelMap = new LinkedHashMap<>();
for (int i = 4; i < split2.length - 1; i++) {
if (split2[i].equals("null")) {
labelMap.put(-1 - labelMap.size(), null);
} else {
labelMap.put(Integer.parseInt(split2[i]), null);
}
}
LabelNode dflt = null;
if (!split2[2].substring(9).equals("null")) {
@@ -1242,9 +1250,13 @@ public class Assembler {
} else if (stage == 0) {
keys.add(Integer.parseInt(spl));
} else if (stage == 2) {
if (spl.equals("null")) {
labelMap.put(-1 - labelMap.size(), null);
} else {
labelMap.put(Integer.parseInt(spl), null);
}
}
}
LabelNode dflt = null;
int labelNr = Integer.parseInt(split2[0].substring(9));
@@ -1330,25 +1342,24 @@ public class Assembler {
String target = split[2];
int index = target.lastIndexOf("/");
return new MethodInsnNode(182, target.substring(0, index), target.substring(index + 1), split[1],
split.length == 4);
false);
}
case "invokespecial": {
String target = split[2];
int index = target.lastIndexOf("/");
return new MethodInsnNode(183, target.substring(0, index), target.substring(index + 1), split[1],
split.length == 4);
false);
}
case "invokestatic": {
String target = split[2];
int index = target.lastIndexOf("/");
return new MethodInsnNode(184, target.substring(0, index), target.substring(index + 1), split[1],
split.length == 4);
false);
}
case "invokeinterface": {
String target = split[2];
int index = target.lastIndexOf("/");
return new MethodInsnNode(185, target.substring(0, index), target.substring(index + 1), split[1],
split.length == 4);
return new MethodInsnNode(185, target.substring(0, index), target.substring(index + 1), split[1], true);
}
case "invokedynamic": {
String str = s.substring(16, s.length() - 2).replace("", "");
+1 -1
View File
@@ -421,7 +421,7 @@ public class Disassembler {
case "MethodInsnNode": {
MethodInsnNode node = (MethodInsnNode) n;
s += "\t\t" + OpcodesReverse.reverseOpcode(node.getOpcode()) + " " + node.desc + " " + node.owner + "/"
+ node.name + (node.itf ? " true" : "") + "\n";
+ node.name + "\n";
break;
}
case "TypeInsnNode": {