Commit e5d304a4 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

AdvancedSorter: rewrapped condition and clarified exception message.

parent be2719e5
...@@ -27,23 +27,23 @@ public class AdvancedSorter extends TryCatchBlockSorter { ...@@ -27,23 +27,23 @@ public class AdvancedSorter extends TryCatchBlockSorter {
tcbs = tryCatchBlocks.toArray(tcbs); tcbs = tryCatchBlocks.toArray(tcbs);
for (int i = 0; i < tcbs.length; i++) { for (int i = 0; i < tcbs.length; i++) {
int istart = instructions.indexOf(Insns.FORWARD.firstRealInsn (tcbs[i].start)); int istart = instructions.indexOf(Insns.FORWARD.firstRealInsn (tcbs[i].start));
int iend = instructions.indexOf(tcbs[i].end); int iend = instructions.indexOf(tcbs[i].end);
for (int j = i; j < tcbs.length; j++) { for (int j = i; j < tcbs.length; j++) {
int jstart = instructions.indexOf(Insns.FORWARD.firstRealInsn (tcbs[j].start)); int jstart = instructions.indexOf(Insns.FORWARD.firstRealInsn (tcbs[j].start));
int jend = instructions.indexOf(tcbs[j].end); int jend = instructions.indexOf(tcbs[j].end);
if ((AsmHelper.offsetBefore(instructions, istart, jstart) if ((
&& AsmHelper.offsetBefore(instructions, jstart, iend) AsmHelper.offsetBefore(instructions, istart, jstart) &&
&& AsmHelper.offsetBefore(instructions, iend, jend)) || AsmHelper.offsetBefore(instructions, jstart, iend) &&
(AsmHelper.offsetBefore(instructions, jstart, istart) AsmHelper.offsetBefore(instructions, iend, jend)
&& AsmHelper.offsetBefore(instructions, istart, jend) ) || (
&& AsmHelper.offsetBefore(instructions, jend, iend))) { AsmHelper.offsetBefore(instructions, jstart, istart) &&
AsmHelper.offsetBefore(instructions, istart, jend) &&
throw new DiSLFatalException("Crossing exception handler."); AsmHelper.offsetBefore(instructions, jend, iend)
)) {
throw new DiSLFatalException ("Overlapping exception handler.");
} }
} }
} }
......
Supports Markdown
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