Browse Source

fixed JASSIST-216

tags/rel_3_19_0_ga
chibash 10 years ago
parent
commit
23b36218f5

+ 1
- 1
Readme.html View File



<p>-version 3.19 <p>-version 3.19
<ul> <ul>
<li>JIRA JASSIST-158, 205, 206, 207.
<li>JIRA JASSIST-158, 205, 206, 207, 212, 216.
</ul> </ul>
</p> </p>



+ 7
- 1
src/main/javassist/bytecode/analysis/ControlFlow.java View File

Block e = b.exit(k); Block e = b.exit(k);
e.entrances[counters[e.index]++] = b; e.entrances[counters[e.index]++] = b;
} }

ControlFlow.Catcher[] catchers = b.catchers();
for (int k = 0; k < catchers.length; k++) {
Block catchBlock = catchers[k].node;
catchBlock.entrances[counters[catchBlock.index]++] = b;
}
} }
} }


super.toString2(sbuf); super.toString2(sbuf);
sbuf.append(", incoming{"); sbuf.append(", incoming{");
for (int i = 0; i < entrances.length; i++) for (int i = 0; i < entrances.length; i++)
sbuf.append(entrances[i].position).append(", ");
sbuf.append(entrances[i].position).append(", ");


sbuf.append("}"); sbuf.append("}");
} }

+ 21
- 0
src/test/test/javassist/bytecode/analysis/DomTreeTest.java View File



return i + 3; return i + 3;
} }

public void testDomtree3() throws Exception {
ControlFlow cf = new ControlFlow(pool.get(DomTreeTest.class.getName()).getDeclaredMethod("test3"));
Block[] blocks = cf.basicBlocks();
for (int i = 0; i < blocks.length; i++)
System.out.println(blocks[i]);
}

public int test3(int i, int j) {
while (i > 0) {
try {
j++;
}
catch (Throwable t) {
j = 0;
}
i--;
}

return j;
}
} }

Loading…
Cancel
Save