Browse Source

fixed JASSIST-216

tags/rel_3_19_0_ga
chibash 10 years ago
parent
commit
23b36218f5

+ 1
- 1
Readme.html View File

@@ -283,7 +283,7 @@ see javassist.Dump.

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


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

@@ -86,6 +86,12 @@ public class ControlFlow {
Block e = b.exit(k);
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;
}
}
}

@@ -245,7 +251,7 @@ public class ControlFlow {
super.toString2(sbuf);
sbuf.append(", incoming{");
for (int i = 0; i < entrances.length; i++)
sbuf.append(entrances[i].position).append(", ");
sbuf.append(entrances[i].position).append(", ");

sbuf.append("}");
}

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

@@ -89,4 +89,25 @@ public class DomTreeTest extends TestCase {

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