Commit 9d14f189 authored by Dave Grove's avatar Dave Grove

fix bug in recomputeNormalOut.

If a branch instruction or fall through has been introduced whose target is an ExceptionHandlerBasicBlock,then we must set the bit on the target exception handler basic block that indicates it has a normal in edge.  Failure to do this results in improper computation of the normal out edges of the source block.
parent e9cc5e9a
......@@ -618,7 +618,7 @@ public class BasicBlock extends SortedGraphNode {
flags |= EXCEPTION_HANDLER_WITH_NORMAL_IN;
}
private boolean isExceptionHandlerWithNormalIn() {
public final boolean isExceptionHandlerWithNormalIn() {
return (flags & EXCEPTION_HANDLER_WITH_NORMAL_IN) != 0;
}
......@@ -1191,12 +1191,19 @@ public class BasicBlock extends SortedGraphNode {
Instruction branch = e.next();
BasicBlockEnumeration targets = branch.getBranchTargets();
while (targets.hasMoreElements()) {
insertOut(targets.next());
BasicBlock targetBlock = targets.next();
if (targetBlock.isExceptionHandlerBasicBlock()) {
targetBlock.setExceptionHandlerWithNormalIn();
}
insertOut(targetBlock);
}
}
// Check for fallthrough edge
BasicBlock fallThrough = getFallThroughBlock();
if (fallThrough != null) {
if (fallThrough.isExceptionHandlerBasicBlock()) {
fallThrough.setExceptionHandlerWithNormalIn();
}
insertOut(fallThrough);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment