You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
746 B
23 lines
746 B
package jode;
|
|
|
|
public class CreateWhileStatements implements Transformation {
|
|
|
|
public InstructionHeader transform(InstructionHeader gotoIH) {
|
|
|
|
if (gotoIH.flowType != gotoIH.GOTO || gotoIH.nextInstruction == null ||
|
|
gotoIH.successors[0].addr < gotoIH.nextInstruction.addr)
|
|
return null;
|
|
|
|
InstructionHeader block = gotoIH.nextInstruction;
|
|
InstructionHeader ifgoto = gotoIH.successors[0];
|
|
|
|
if (ifgoto.getFlowType() != ifgoto.IFGOTO ||
|
|
ifgoto.successors[1] != block ||
|
|
ifgoto.outer != block.outer)
|
|
return null;
|
|
|
|
if(Decompiler.isVerbose)
|
|
System.err.print("w");
|
|
return new WhileInstructionHeader(gotoIH, ifgoto, block);
|
|
}
|
|
}
|
|
|