* jode/obfuscator/ClassIdentifier.java.in (transformInnerClasses):

Bug fix: Added missing checks for STRIP_UNREACH.
* jode/obfuscator/MethodIdentifier.java.in (doTransformation):
Don't run analyzer on unreachable methods.  Previously the
ConstantAnalyzer assumed that the instructions are not reachable
and removed them all leading to illegal bytecode.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1361 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 23 years ago
parent a0caad2c2c
commit 111d5046ea
  1. 10
      jode/ChangeLog
  2. 10
      jode/jode/obfuscator/ClassIdentifier.java.in
  3. 4
      jode/jode/obfuscator/MethodIdentifier.java.in

@ -1,3 +1,13 @@
2002-02-08 Jochen Hoenicke <jochen@gnu.org>
* jode/obfuscator/ClassIdentifier.java.in (transformInnerClasses):
Bug fix: Added missing checks for STRIP_UNREACH.
* jode/obfuscator/MethodIdentifier.java.in (doTransformation):
Don't run analyzer on unreachable methods. Previously the
ConstantAnalyzer assumed that the instructions are not reachable
and removed them all leading to illegal bytecode.
2002-02-01 Jochen Hoenicke <jochen@gnu.org> 2002-02-01 Jochen Hoenicke <jochen@gnu.org>
* jode/flow/CreateAssignExpression.java (createAssignOp): * jode/flow/CreateAssignExpression.java (createAssignOp):

@ -517,7 +517,8 @@ public class ClassIdentifier extends Identifier {
.getClassIdentifier(outerClasses[i].outer)) .getClassIdentifier(outerClasses[i].outer))
: null; : null;
if (outerIdent != null && !outerIdent.isReachable()) if ((Main.stripping & Main.STRIP_UNREACH) != 0
&& outerIdent != null && !outerIdent.isReachable())
continue; continue;
String inner = lastClass; String inner = lastClass;
@ -556,9 +557,8 @@ public class ClassIdentifier extends Identifier {
for (int i=0; i<innerClasses.length; i++) { for (int i=0; i<innerClasses.length; i++) {
ClassIdentifier innerIdent = Main.getClassBundle() ClassIdentifier innerIdent = Main.getClassBundle()
.getClassIdentifier(innerClasses[i].inner); .getClassIdentifier(innerClasses[i].inner);
if (innerIdent != null if ((Main.stripping & Main.STRIP_UNREACH) != 0
&& (Main.stripping & Main.STRIP_UNREACH) != 0 && innerIdent != null && !innerIdent.isReachable())
&& !innerIdent.isReachable())
continue; continue;
String inner = innerIdent == null String inner = innerIdent == null
@ -609,10 +609,12 @@ public class ClassIdentifier extends Identifier {
ClassIdentifier innerIdent = Main.getClassBundle() ClassIdentifier innerIdent = Main.getClassBundle()
.getClassIdentifier(extraClasses[i].inner); .getClassIdentifier(extraClasses[i].inner);
if ((Main.stripping & Main.STRIP_UNREACH) != 0) {
if (innerIdent != null && !innerIdent.isReachable()) if (innerIdent != null && !innerIdent.isReachable())
continue; continue;
if (outerIdent != null && !outerIdent.isReachable()) if (outerIdent != null && !outerIdent.isReachable())
continue; continue;
}
String inner = innerIdent == null String inner = innerIdent == null
? extraClasses[i].inner ? extraClasses[i].inner

@ -169,6 +169,10 @@ public class MethodIdentifier extends Identifier implements Opcodes {
if (codeAnalyzer != null) { if (codeAnalyzer != null) {
BytecodeInfo bytecode = info.getBytecode(); BytecodeInfo bytecode = info.getBytecode();
try { try {
/* Only run analyzer on reachable methods. Other methods
* weren't analyzed, so running analyzer on them is wrong.
*/
if (isReachable())
codeAnalyzer.transformCode(bytecode); codeAnalyzer.transformCode(bytecode);
CodeTransformer[] trafos = bundle.getPostTransformers(); CodeTransformer[] trafos = bundle.getPostTransformers();
for (int i = 0; i < trafos.length; i++) { for (int i = 0; i < trafos.length; i++) {

Loading…
Cancel
Save