Permalink
Browse files

do not weave unreachable code -- since we cannot analyze it, we also …

…cannot weave it.
  • Loading branch information...
1 parent 48bc0e6 commit c14af3ca97662df8be05e00f56628bab5c316e83 @krestenkrab committed Dec 13, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/kilim/analysis/MethodWeaver.java
View
4 src/kilim/analysis/MethodWeaver.java
@@ -184,7 +184,7 @@ private void visitInstructions(MethodVisitor mv) {
for (BasicBlock bb : mf.getBasicBlocks()) {
int from = bb.startPos;
- if (bb.isPausable()) {
+ if (bb.isPausable() && bb.startFrame != null) {
genPausableMethod(mv, bb);
from = bb.startPos + 1; // first instruction is consumed
} else if (bb.isCatchHandler()) {
@@ -286,7 +286,7 @@ void genGetCurrentTask(MethodVisitor mv, BasicBlock bb) {
private void createCallWeavers() {
MethodFlow mf = methodFlow;
for (BasicBlock bb : mf.getBasicBlocks()) {
- if (!bb.isPausable()) continue;
+ if (!bb.isPausable() || bb.startFrame==null) continue;
// No prelude needed for Task.getCurrentTask().
if (bb.isGetCurrentTask()) continue;
CallWeaver cw = new CallWeaver(this, bb);

0 comments on commit c14af3c

Please sign in to comment.