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

Loading…
Cancel
Save