use of org.candle.decompiler.intermediate.expression.Return in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitLRETURN.
public void visitLRETURN(LRETURN instruction) {
Expression exp = context.getExpressions().pop();
Return ret = new Return(context.getCurrentInstruction(), exp);
processReturn(ret);
}
use of org.candle.decompiler.intermediate.expression.Return in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitIRETURN.
public void visitIRETURN(IRETURN instruction) {
Expression exp = context.getExpressions().pop();
Return ret = new Return(context.getCurrentInstruction(), exp);
processReturn(ret);
}
use of org.candle.decompiler.intermediate.expression.Return in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitARETURN.
public void visitARETURN(ARETURN instruction) {
Expression exp = context.getExpressions().pop();
Return ret = new Return(context.getCurrentInstruction(), exp);
processReturn(ret);
}
use of org.candle.decompiler.intermediate.expression.Return in project candle-decompiler by bradsdavis.
the class IntermediateGraphFactory method visitStatementIntermediate.
@Override
public void visitStatementIntermediate(StatementIntermediate line) {
AbstractIntermediate next = ilc.getNext(line);
// check to see if it is a return statement.
if (line.getExpression() instanceof Return) {
// don't add a line to next.
return;
}
if (line.getExpression() instanceof Throw) {
// don't add a line to next.
return;
}
if (next != null) {
// find how that actually maps to the abstract line..
AbstractIntermediate intermediate = next;
// now, we just add this into the graph.
igc.getGraph().addVertex(intermediate);
igc.getGraph().addEdge(line, intermediate);
}
}
use of org.candle.decompiler.intermediate.expression.Return in project candle-decompiler by bradsdavis.
the class CatchUpperRangeVisitor method visitCatchIntermediate.
@Override
public void visitCatchIntermediate(CatchIntermediate line) {
// first, check if the line has an end already..
if (line.getBlockRange().getEnd() != null) {
return;
}
// processLastCatch(line);
BreadthFirstIterator<AbstractIntermediate, IntermediateEdge> bfi = new BreadthFirstIterator<AbstractIntermediate, IntermediateEdge>(igc.getGraph(), line);
AbstractIntermediate lastStatement = null;
while (bfi.hasNext()) {
AbstractIntermediate next = bfi.next();
if (next instanceof GoToIntermediate) {
// this would be a possible GOTO... find previous.
LOG.debug("Catch GOGO: " + next + " goto:" + next.getInstruction().getPosition());
lastStatement = igc.getSinglePredecessor(next);
break;
}
if (next instanceof StatementIntermediate) {
// determine what type of statement...
if (((StatementIntermediate) next).getExpression() instanceof Throw) {
lastStatement = next;
break;
}
if (((StatementIntermediate) next).getExpression() instanceof Return) {
lastStatement = next;
break;
}
}
}
if (lastStatement != null) {
line.getBlockRange().setEnd(lastStatement.getInstruction());
}
}
Aggregations