@Override public Statement getSimpleCopy() { CatchStatement cs = new CatchStatement(); for (List<String> exc : this.exctstrings) { cs.exctstrings.add(new ArrayList<>(exc)); cs.vars.add(new VarExprent(DecompilerContext.getCounterContainer().getCounterAndIncrement(CounterContainer.VAR_COUNTER), new VarType(CodeConstants.TYPE_OBJECT, 0, exc.get(0)), DecompilerContext.getVarProcessor())); } return cs; }
if (root != null && root.getFirst().type == Statement.TYPE_TRYCATCH) { CatchStatement cst = (CatchStatement)root.getFirst(); if (cst.getStats().size() == 2 && cst.getFirst().type == Statement.TYPE_BASICBLOCK && cst.getStats().get(1).type == Statement.TYPE_BASICBLOCK && cst.getVars().get(0).getVarType().equals(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/ClassNotFoundException"))) { BasicBlockStatement body = (BasicBlockStatement)cst.getFirst(); BasicBlockStatement handler = (BasicBlockStatement)cst.getStats().get(1);
if ((res = CatchStatement.isHead(head)) != null) { return res;
lstVars = ((CatchStatement)stat).getVars();
if (isLabeled()) { buf.appendIndent(indent).append("label").append(this.id.toString()).append(":").appendLineSeparator(); tracer.incrementCurrentSourceLine();
private static void collectCatchVars(Statement stat, FlattenStatementsHelper flatthelper, Map<String, VarExprent> map) { List<VarExprent> lst = null; if (stat.type == Statement.TYPE_CATCHALL) { CatchAllStatement catchall = (CatchAllStatement)stat; if (!catchall.isFinally()) { lst = catchall.getVars(); } } else if (stat.type == Statement.TYPE_TRYCATCH) { lst = ((CatchStatement)stat).getVars(); } if (lst != null) { for (int i = 1; i < stat.getStats().size(); i++) { map.put(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0], lst.get(i - 1)); } } for (Statement st : stat.getStats()) { collectCatchVars(st, flatthelper, map); } }
if (isLabeled()) { buf.appendIndent(indent).append("label").append(this.id.toString()).append(":").appendLineSeparator(); tracer.incrementCurrentSourceLine();
if (root != null && root.getFirst().type == Statement.TYPE_TRYCATCH) { CatchStatement cst = (CatchStatement)root.getFirst(); if (cst.getStats().size() == 2 && cst.getFirst().type == Statement.TYPE_BASICBLOCK && cst.getStats().get(1).type == Statement.TYPE_BASICBLOCK && cst.getVars().get(0).getVarType().equals(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/ClassNotFoundException"))) { BasicBlockStatement body = (BasicBlockStatement)cst.getFirst(); BasicBlockStatement handler = (BasicBlockStatement)cst.getStats().get(1);
private void setCatchMaps(Statement stat, DirectGraph dgraph, FlattenStatementsHelper flatthelper) { SFormsFastMapDirect map; switch (stat.type) { case Statement.TYPE_CATCHALL: case Statement.TYPE_TRYCATCH: List<VarExprent> lstVars; if (stat.type == Statement.TYPE_CATCHALL) { lstVars = ((CatchAllStatement)stat).getVars(); } else { lstVars = ((CatchStatement)stat).getVars(); } for (int i = 1; i < stat.getStats().size(); i++) { int varindex = lstVars.get(i - 1).getIndex(); int version = getNextFreeVersion(varindex); // == 1 map = new SFormsFastMapDirect(); setCurrentVar(map, varindex, version); extraVarVersions.put(dgraph.nodes.getWithKey(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0]).id, map); } } for (Statement st : stat.getStats()) { setCatchMaps(st, dgraph, flatthelper); } }
return new CatchStatement(head, next, setHandlers);
if ((res = CatchStatement.isHead(head)) != null) { return res;
lstVars = ((CatchStatement)st).getVars();
public Statement getSimpleCopy() { CatchStatement cs = new CatchStatement(); for (List<String> exc : this.exctstrings) { cs.exctstrings.add(new ArrayList<>(exc)); cs.vars.add(new VarExprent(DecompilerContext.getCounterContainer().getCounterAndIncrement(CounterContainer.VAR_COUNTER), new VarType(CodeConstants.TYPE_OBJECT, 0, exc.get(0)), (VarProcessor)DecompilerContext.getProperty(DecompilerContext.CURRENT_VAR_PROCESSOR))); } return cs; }
private void setCatchMaps(Statement stat, DirectGraph dgraph, FlattenStatementsHelper flatthelper) { SFormsFastMapDirect map; switch (stat.type) { case Statement.TYPE_CATCHALL: case Statement.TYPE_TRYCATCH: List<VarExprent> lstVars; if (stat.type == Statement.TYPE_CATCHALL) { lstVars = ((CatchAllStatement)stat).getVars(); } else { lstVars = ((CatchStatement)stat).getVars(); } for (int i = 1; i < stat.getStats().size(); i++) { int varindex = lstVars.get(i - 1).getIndex(); int version = getNextFreeVersion(varindex, stat); // == 1 map = new SFormsFastMapDirect(); setCurrentVar(map, varindex, version); extraVarVersions.put(dgraph.nodes.getWithKey(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0]).id, map); //ssuversions.createOrGetNode(new VarVersionPair(varindex, version)); ssuversions.createNode(new VarVersionPair(varindex, version)); } } for (Statement st : stat.getStats()) { setCatchMaps(st, dgraph, flatthelper); } }
return new CatchStatement(head, next, setHandlers);
lstVars = ((CatchStatement)stat).getVars();
private static void collectCatchVars(Statement stat, FlattenStatementsHelper flatthelper, Map<String, VarExprent> map) { List<VarExprent> lst = null; if (stat.type == Statement.TYPE_CATCHALL) { CatchAllStatement catchall = (CatchAllStatement)stat; if (!catchall.isFinally()) { lst = catchall.getVars(); } } else if (stat.type == Statement.TYPE_TRYCATCH) { lst = ((CatchStatement)stat).getVars(); } if (lst != null) { for (int i = 1; i < stat.getStats().size(); i++) { map.put(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0], lst.get(i - 1)); } } for (Statement st : stat.getStats()) { collectCatchVars(st, flatthelper, map); } }
private void setCatchMaps(Statement stat, DirectGraph dgraph, FlattenStatementsHelper flatthelper) { SFormsFastMapDirect map; switch (stat.type) { case Statement.TYPE_CATCHALL: case Statement.TYPE_TRYCATCH: List<VarExprent> lstVars; if (stat.type == Statement.TYPE_CATCHALL) { lstVars = ((CatchAllStatement)stat).getVars(); } else { lstVars = ((CatchStatement)stat).getVars(); } for (int i = 1; i < stat.getStats().size(); i++) { int varindex = lstVars.get(i - 1).getIndex(); int version = getNextFreeVersion(varindex); // == 1 map = new SFormsFastMapDirect(); setCurrentVar(map, varindex, version); extraVarVersions.put(dgraph.nodes.getWithKey(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0]).id, map); startVars.add(new VarVersionPair(varindex, version)); } } for (Statement st : stat.getStats()) { setCatchMaps(st, dgraph, flatthelper); } }
lstVars = ((CatchStatement)st).getVars();
private void setCatchMaps(Statement stat, DirectGraph dgraph, FlattenStatementsHelper flatthelper) { SFormsFastMapDirect map; switch (stat.type) { case Statement.TYPE_CATCHALL: case Statement.TYPE_TRYCATCH: List<VarExprent> lstVars; if (stat.type == Statement.TYPE_CATCHALL) { lstVars = ((CatchAllStatement)stat).getVars(); } else { lstVars = ((CatchStatement)stat).getVars(); } for (int i = 1; i < stat.getStats().size(); i++) { int varindex = lstVars.get(i - 1).getIndex(); int version = getNextFreeVersion(varindex, stat); // == 1 map = new SFormsFastMapDirect(); setCurrentVar(map, varindex, version); extraVarVersions.put(dgraph.nodes.getWithKey(flatthelper.getMapDestinationNodes().get(stat.getStats().get(i).id)[0]).id, map); //ssuversions.createOrGetNode(new VarVersionPair(varindex, version)); ssuversions.createNode(new VarVersionPair(varindex, version)); } } for (Statement st : stat.getStats()) { setCatchMaps(st, dgraph, flatthelper); } }