clinit is always reachable, even if the class is not yet

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@541 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 26340e1f1f
commit 42dfa8092d
  1. 13
      jode/jode/obfuscator/ClassIdentifier.java

@ -183,7 +183,6 @@ public class ClassIdentifier extends Identifier {
public void analyze() { public void analyze() {
if (Obfuscator.isVerbose) if (Obfuscator.isVerbose)
Obfuscator.err.println("Reachable: "+this); Obfuscator.err.println("Reachable: "+this);
reachableIdentifier("<clinit>", "()V", false);
} }
public void initClass() { public void initClass() {
@ -223,8 +222,14 @@ public class ClassIdentifier extends Identifier {
for (int i=0; i< minfos.length; i++) { for (int i=0; i< minfos.length; i++) {
identifiers[fieldCount + i] identifiers[fieldCount + i]
= new MethodIdentifier(this, minfos[i]); = new MethodIdentifier(this, minfos[i]);
if (identifiers[i].getName().equals("<init>")) if (identifiers[fieldCount + i].getName().equals("<clinit>")) {
identifiers[i].setPreserved(); /* If there is a static initializer, it is automagically
* reachable (even if this class wouldn't be otherwise).
*/
identifiers[fieldCount + i].setPreserved();
identifiers[fieldCount + i].setReachable();
} else if (identifiers[fieldCount + i].getName().equals("<init>"))
identifiers[fieldCount + i].setPreserved();
} }
ClassInfo[] ifaces = info.getInterfaces(); ClassInfo[] ifaces = info.getInterfaces();
@ -245,8 +250,6 @@ public class ClassIdentifier extends Identifier {
} }
initSuperClasses(info.getSuperclass()); initSuperClasses(info.getSuperclass());
} }
preserveIdentifier("<clinit>", "()V");
preserveIdentifier("<init>", null);
} }
public void buildTable(int renameRule) { public void buildTable(int renameRule) {

Loading…
Cancel
Save