Skip to content

Commit

Permalink
do not weave unreachable code -- since we cannot analyze it, we also …
Browse files Browse the repository at this point in the history
…cannot weave it.
  • Loading branch information
krestenkrab committed Dec 13, 2009
1 parent 48bc0e6 commit c14af3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kilim/analysis/MethodWeaver.java
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c14af3c

Please sign in to comment.