mapStackToLocal had some bugs

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@343 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 5407fb0089
commit 251bba903d
  1. 45
      jode/jode/flow/LoopBlock.java

@ -320,19 +320,38 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock {
* otherwise the stack after the block has executed. * otherwise the stack after the block has executed.
*/ */
public VariableStack mapStackToLocal(VariableStack stack) { public VariableStack mapStackToLocal(VariableStack stack) {
continueStack = stack; if (type == DOWHILE) {
VariableStack newStack; VariableStack afterBody = bodyBlock.mapStackToLocal(stack);
int params = cond.getOperandCount(); if (afterBody != null)
if (params > 0) { mergeContinueStack(afterBody);
condStack = stack.peek(params);
newStack = stack.pop(params); if (continueStack != null) {
} else VariableStack newStack;
newStack = stack; int params = cond.getOperandCount();
if (params > 0) {
VariableStack afterBody = bodyBlock.mapStackToLocal(newStack); condStack = continueStack.peek(params);
if (afterBody != null) newStack = continueStack.pop(params);
mergeContinueStack(afterBody); } else
newStack = continueStack;
if (cond != TRUE)
mergeBreakedStack(newStack);
}
} else {
continueStack = stack;
VariableStack newStack;
int params = cond.getOperandCount();
if (params > 0) {
condStack = stack.peek(params);
newStack = stack.pop(params);
} else
newStack = stack;
if (cond != TRUE)
breakedStack = newStack;
VariableStack afterBody = bodyBlock.mapStackToLocal(newStack);
if (afterBody != null)
mergeContinueStack(afterBody);
}
return breakedStack; return breakedStack;
} }

Loading…
Cancel
Save