* jode/jvm/SyntheticAnalyzer.java.in:

(checkGetClass): Ignore nop opcodes.
(checkStaticAccess): Likewise.
(checkAccess): Likewise.
(checkConstructorAccess): Likewise.
* jode/flow/TransformConstructors.java (Constructor): Ignore
OuterValues for static constructor.
* jode/expr/NewArrayOperator.java (dumpExpression): Added
a missing breakOp.
* jode/expr/CompareToIntOperator.java (dumpExpression): Likewise.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1321 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent 5a4dbe0b02
commit fbcfb06d90
  1. 15
      jode/ChangeLog
  2. 2
      jode/doc/Makefile.am
  3. 1
      jode/jode/expr/CompareToIntOperator.java
  4. 1
      jode/jode/expr/NewArrayOperator.java
  5. 1
      jode/jode/flow/TransformConstructors.java
  6. 30
      jode/jode/jvm/SyntheticAnalyzer.java.in

@ -1,3 +1,18 @@
2001-06-15 Jochen Hoenicke <jochen@gnu.org>
* jode/jvm/SyntheticAnalyzer.java.in:
(checkGetClass): Ignore nop opcodes.
(checkStaticAccess): Likewise.
(checkAccess): Likewise.
(checkConstructorAccess): Likewise.
* jode/flow/TransformConstructors.java (Constructor): Ignore
OuterValues for static constructor.
* jode/expr/NewArrayOperator.java (dumpExpression): Added
a missing breakOp.
* jode/expr/CompareToIntOperator.java (dumpExpression): Likewise.
2001-06-01 Jochen Hoenicke <jochen@gnu.org> 2001-06-01 Jochen Hoenicke <jochen@gnu.org>
* jode/obfuscator/modules/ConstantAnalyzer.java.in: * jode/obfuscator/modules/ConstantAnalyzer.java.in:

@ -13,7 +13,7 @@ links.php \
usage.php usage.php
HTML_FILES = $(PHP_FILES:%.php=$(srcdir)/%.html) HTML_FILES = $(PHP_FILES:%.php=$(srcdir)/%.html)
noinst_DATA = $(HTML_FILES) # noinst_DATA = $(HTML_FILES)
EXTRA_DIST = $(PHP_FILES) $(notdir $(HTML_FILES)) \ EXTRA_DIST = $(PHP_FILES) $(notdir $(HTML_FILES)) \
header.inc \ header.inc \

@ -54,6 +54,7 @@ public class CompareToIntOperator extends Operator {
throws java.io.IOException throws java.io.IOException
{ {
subExpressions[0].dumpExpression(writer, 550); subExpressions[0].dumpExpression(writer, 550);
writer.breakOp();
writer.print(" <=>"); writer.print(" <=>");
if (allowsNaN) if (allowsNaN)
writer.print(greaterOnNaN ? "g" : "l"); writer.print(greaterOnNaN ? "g" : "l");

@ -57,6 +57,7 @@ public class NewArrayOperator extends Operator {
writer.print("new "); writer.print("new ");
writer.printType(flat.getHint()); writer.printType(flat.getHint());
for (int i=0; i< depth; i++) { for (int i=0; i< depth; i++) {
writer.breakOp();
writer.print("["); writer.print("[");
if (i < subExpressions.length) if (i < subExpressions.length)
subExpressions[i].dumpExpression(writer, 0); subExpressions[i].dumpExpression(writer, 0);

@ -105,6 +105,7 @@ public class TransformConstructors {
this.clazzAnalyzer = clazzAnalyzer; this.clazzAnalyzer = clazzAnalyzer;
this.isStatic = isStatic; this.isStatic = isStatic;
this.cons = cons; this.cons = cons;
if (!isStatic)
this.outerValues = clazzAnalyzer.getOuterValues(); this.outerValues = clazzAnalyzer.getOuterValues();
lookForConstructorCall(); lookForConstructorCall();
} }

@ -117,6 +117,8 @@ public class SyntheticAnalyzer implements Opcodes {
int i = 0; int i = 0;
for (Iterator iter = bytecode.getInstructions().iterator(); iter.hasNext(); i++) { for (Iterator iter = bytecode.getInstructions().iterator(); iter.hasNext(); i++) {
Instruction instr = (Instruction) iter.next(); Instruction instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (i == getClassOpcodes.length if (i == getClassOpcodes.length
|| instr.getOpcode() != getClassOpcodes[i]) || instr.getOpcode() != getClassOpcodes[i])
return false; return false;
@ -152,6 +154,8 @@ public class SyntheticAnalyzer implements Opcodes {
boolean dupSeen = false; boolean dupSeen = false;
Instruction instr = (Instruction) iter.next(); Instruction instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() == opc_getstatic) { if (instr.getOpcode() == opc_getstatic) {
Reference ref = instr.getReference(); Reference ref = instr.getReference();
ClassInfo refClazz = TypeSignature.getClassInfo(ref.getClazz()); ClassInfo refClazz = TypeSignature.getClassInfo(ref.getClazz());
@ -162,6 +166,8 @@ public class SyntheticAnalyzer implements Opcodes {
if ((refField.getModifiers() & modifierMask) != Modifier.STATIC) if ((refField.getModifiers() & modifierMask) != Modifier.STATIC)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() < opc_ireturn if (instr.getOpcode() < opc_ireturn
|| instr.getOpcode() > opc_areturn) || instr.getOpcode() > opc_areturn)
return false; return false;
@ -178,12 +184,16 @@ public class SyntheticAnalyzer implements Opcodes {
slot += (instr.getOpcode() == opc_lload slot += (instr.getOpcode() == opc_lload
|| instr.getOpcode() == opc_dload) ? 2 : 1; || instr.getOpcode() == opc_dload) ? 2 : 1;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
} }
if (instr.getOpcode() == (opc_dup - 3) + 3 * slot) { if (instr.getOpcode() == (opc_dup - 3) + 3 * slot) {
/* This is probably a opc_dup or opc_dup2, /* This is probably a opc_dup or opc_dup2,
* preceding a opc_putstatic * preceding a opc_putstatic
*/ */
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() != opc_putstatic) if (instr.getOpcode() != opc_putstatic)
return false; return false;
dupSeen = true; dupSeen = true;
@ -201,6 +211,8 @@ public class SyntheticAnalyzer implements Opcodes {
if ((refField.getModifiers() & modifierMask) != Modifier.STATIC) if ((refField.getModifiers() & modifierMask) != Modifier.STATIC)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (dupSeen) { if (dupSeen) {
if (instr.getOpcode() < opc_ireturn if (instr.getOpcode() < opc_ireturn
|| instr.getOpcode() > opc_areturn) || instr.getOpcode() > opc_areturn)
@ -226,6 +238,8 @@ public class SyntheticAnalyzer implements Opcodes {
|| refType.getParameterTypes().length != params) || refType.getParameterTypes().length != params)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (refType.getReturnType() == Type.tVoid) { if (refType.getReturnType() == Type.tVoid) {
if (instr.getOpcode() != opc_return) if (instr.getOpcode() != opc_return)
return false; return false;
@ -258,9 +272,13 @@ public class SyntheticAnalyzer implements Opcodes {
Iterator iter = bytecode.getInstructions().iterator(); Iterator iter = bytecode.getInstructions().iterator();
Instruction instr = (Instruction) iter.next(); Instruction instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() != opc_aload || instr.getLocalSlot() != 0) if (instr.getOpcode() != opc_aload || instr.getLocalSlot() != 0)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() == opc_getfield) { if (instr.getOpcode() == opc_getfield) {
Reference ref = instr.getReference(); Reference ref = instr.getReference();
@ -272,6 +290,8 @@ public class SyntheticAnalyzer implements Opcodes {
if ((refField.getModifiers() & modifierMask) != 0) if ((refField.getModifiers() & modifierMask) != 0)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() < opc_ireturn if (instr.getOpcode() < opc_ireturn
|| instr.getOpcode() > opc_areturn) || instr.getOpcode() > opc_areturn)
return false; return false;
@ -288,12 +308,16 @@ public class SyntheticAnalyzer implements Opcodes {
slot += (instr.getOpcode() == opc_lload slot += (instr.getOpcode() == opc_lload
|| instr.getOpcode() == opc_dload) ? 2 : 1; || instr.getOpcode() == opc_dload) ? 2 : 1;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
} }
if (instr.getOpcode() == (opc_dup_x1 - 6) + 3 * slot) { if (instr.getOpcode() == (opc_dup_x1 - 6) + 3 * slot) {
/* This is probably a opc_dup_x1 or opc_dup2_x1, /* This is probably a opc_dup_x1 or opc_dup2_x1,
* preceding a opc_putfield * preceding a opc_putfield
*/ */
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (instr.getOpcode() != opc_putfield) if (instr.getOpcode() != opc_putfield)
return false; return false;
dupSeen = true; dupSeen = true;
@ -312,6 +336,8 @@ public class SyntheticAnalyzer implements Opcodes {
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (dupSeen) { if (dupSeen) {
if (instr.getOpcode() < opc_ireturn if (instr.getOpcode() < opc_ireturn
|| instr.getOpcode() > opc_areturn) || instr.getOpcode() > opc_areturn)
@ -337,6 +363,8 @@ public class SyntheticAnalyzer implements Opcodes {
|| refType.getParameterTypes().length != params) || refType.getParameterTypes().length != params)
return false; return false;
instr = (Instruction) iter.next(); instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
if (refType.getReturnType() == Type.tVoid) { if (refType.getReturnType() == Type.tVoid) {
if (instr.getOpcode() != opc_return) if (instr.getOpcode() != opc_return)
return false; return false;
@ -365,6 +393,8 @@ public class SyntheticAnalyzer implements Opcodes {
Iterator iter = bytecode.getInstructions().iterator(); Iterator iter = bytecode.getInstructions().iterator();
Instruction instr = (Instruction) iter.next(); Instruction instr = (Instruction) iter.next();
while (instr.getOpcode() == opc_nop && iter.hasNext())
instr = (Instruction) iter.next();
int params = 0, slot = 0; int params = 0, slot = 0;
while (instr.getOpcode() >= opc_iload while (instr.getOpcode() >= opc_iload
&& instr.getOpcode() <= opc_aload) { && instr.getOpcode() <= opc_aload) {

Loading…
Cancel
Save