do not process vars if there were errors in the method
This commit is contained in:
@@ -158,31 +158,33 @@ public class ClassWrapper {
|
|||||||
|
|
||||||
methods.addWithKey(methodWrapper, InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor()));
|
methods.addWithKey(methodWrapper, InterpreterUtil.makeUniqueKey(mt.getName(), mt.getDescriptor()));
|
||||||
|
|
||||||
// rename vars so that no one has the same name as a field
|
if (!isError) {
|
||||||
varProc.refreshVarNames(new VarNamesCollector(setFieldNames));
|
// rename vars so that no one has the same name as a field
|
||||||
|
varProc.refreshVarNames(new VarNamesCollector(setFieldNames));
|
||||||
|
|
||||||
// if debug information present and should be used
|
// if debug information present and should be used
|
||||||
if (DecompilerContext.getOption(IFernflowerPreferences.USE_DEBUG_VAR_NAMES)) {
|
if (DecompilerContext.getOption(IFernflowerPreferences.USE_DEBUG_VAR_NAMES)) {
|
||||||
StructLocalVariableTableAttribute attr = mt.getLocalVariableAttr();
|
StructLocalVariableTableAttribute attr = mt.getLocalVariableAttr();
|
||||||
if (attr != null) {
|
if (attr != null) {
|
||||||
// only param names here
|
// only param names here
|
||||||
varProc.setDebugVarNames(attr.getMapParamNames());
|
varProc.setDebugVarNames(attr.getMapParamNames());
|
||||||
|
|
||||||
// the rest is here
|
// the rest is here
|
||||||
methodWrapper.getOrBuildGraph().iterateExprents(exprent -> {
|
methodWrapper.getOrBuildGraph().iterateExprents(exprent -> {
|
||||||
List<Exprent> lst = exprent.getAllExprents(true);
|
List<Exprent> lst = exprent.getAllExprents(true);
|
||||||
lst.add(exprent);
|
lst.add(exprent);
|
||||||
lst.stream()
|
lst.stream()
|
||||||
.filter(e -> e.type == Exprent.EXPRENT_VAR)
|
.filter(e -> e.type == Exprent.EXPRENT_VAR)
|
||||||
.forEach(e -> {
|
.forEach(e -> {
|
||||||
VarExprent varExprent = (VarExprent)e;
|
VarExprent varExprent = (VarExprent)e;
|
||||||
String name = varExprent.getDebugName(mt);
|
String name = varExprent.getDebugName(mt);
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
varProc.setVarName(varExprent.getVarVersionPair(), name);
|
varProc.setVarName(varExprent.getVarVersionPair(), name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user