few fixes of mapStackToLocal

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@374 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent b430017c42
commit 51480f5e92
  1. 16
      jode/jode/flow/FlowBlock.java

@ -1416,7 +1416,8 @@ public class FlowBlock {
*/ */
public final boolean mapStackToLocal() { public final boolean mapStackToLocal() {
try { try {
return mapStackToLocal(VariableStack.EMPTY); mapStackToLocal(VariableStack.EMPTY);
return true;
} catch (RuntimeException ex) { } catch (RuntimeException ex) {
Decompiler.err.println("Can't resolve all PUSHes, " Decompiler.err.println("Can't resolve all PUSHes, "
+"this is probably illegal bytecode:"); +"this is probably illegal bytecode:");
@ -1433,18 +1434,13 @@ public class FlowBlock {
* @return false if the bytecode isn't correct and stack mapping * @return false if the bytecode isn't correct and stack mapping
* didn't worked. * didn't worked.
*/ */
public boolean mapStackToLocal(VariableStack initialStack) { public void mapStackToLocal(VariableStack initialStack) {
if (stackMap != null) { if (stackMap != null) {
stackMap.merge(initialStack); stackMap.merge(initialStack);
} else } else
stackMap = initialStack; stackMap = initialStack;
if (block.mapStackToLocal(initialStack) == null) { block.mapStackToLocal(initialStack);
// bytecode is not correct! Give up!
stackMap = null;
return false;
}
Enumeration enum = successors.elements(); Enumeration enum = successors.elements();
while (enum.hasMoreElements()) { while (enum.hasMoreElements()) {
Jump jumps = (Jump) enum.nextElement(); Jump jumps = (Jump) enum.nextElement();
@ -1455,10 +1451,8 @@ public class FlowBlock {
stack = VariableStack.merge(stack, jumps.stackMap); stack = VariableStack.merge(stack, jumps.stackMap);
} }
if (succ.stackMap == null) if (succ.stackMap == null)
if (!succ.mapStackToLocal(stack)) succ.mapStackToLocal(stack);
return false;
} }
return true;
} }
public void removePush() { public void removePush() {

Loading…
Cancel
Save