|
|
@ -320,6 +320,24 @@ 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) { |
|
|
|
|
|
|
|
if (type == DOWHILE) { |
|
|
|
|
|
|
|
VariableStack afterBody = bodyBlock.mapStackToLocal(stack); |
|
|
|
|
|
|
|
if (afterBody != null) |
|
|
|
|
|
|
|
mergeContinueStack(afterBody); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (continueStack != null) { |
|
|
|
|
|
|
|
VariableStack newStack; |
|
|
|
|
|
|
|
int params = cond.getOperandCount(); |
|
|
|
|
|
|
|
if (params > 0) { |
|
|
|
|
|
|
|
condStack = continueStack.peek(params); |
|
|
|
|
|
|
|
newStack = continueStack.pop(params); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
newStack = continueStack; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cond != TRUE) |
|
|
|
|
|
|
|
mergeBreakedStack(newStack); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
continueStack = stack; |
|
|
|
continueStack = stack; |
|
|
|
VariableStack newStack; |
|
|
|
VariableStack newStack; |
|
|
|
int params = cond.getOperandCount(); |
|
|
|
int params = cond.getOperandCount(); |
|
|
@ -328,11 +346,12 @@ public class LoopBlock extends StructuredBlock implements BreakableBlock { |
|
|
|
newStack = stack.pop(params); |
|
|
|
newStack = stack.pop(params); |
|
|
|
} else |
|
|
|
} else |
|
|
|
newStack = stack; |
|
|
|
newStack = stack; |
|
|
|
|
|
|
|
if (cond != TRUE) |
|
|
|
|
|
|
|
breakedStack = newStack; |
|
|
|
VariableStack afterBody = bodyBlock.mapStackToLocal(newStack); |
|
|
|
VariableStack afterBody = bodyBlock.mapStackToLocal(newStack); |
|
|
|
if (afterBody != null) |
|
|
|
if (afterBody != null) |
|
|
|
mergeContinueStack(afterBody); |
|
|
|
mergeContinueStack(afterBody); |
|
|
|
|
|
|
|
} |
|
|
|
return breakedStack; |
|
|
|
return breakedStack; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|