* 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 23 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. 3
      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>
* jode/obfuscator/modules/ConstantAnalyzer.java.in:

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

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

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

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

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

Loading…
Cancel
Save