* 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. 18
      jode/jode/obfuscator/ClassIdentifier.java.in
  3. 6
      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>
* jode/flow/CreateAssignExpression.java (createAssignOp):

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

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

Loading…
Cancel
Save