Fix EH handling corner case.
commite9d77ca1ac10ec26ebba6a259fe4a87da48f5201
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 24 Aug 2010 19:04:48 +0000 (24 16:04 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 24 Aug 2010 19:38:35 +0000 (24 16:38 -0300)
treea65c63f3f320a588c1691f0a2b2fc295722d954b
parentd4927adac234b9e3effb4db156df78699a27f78b
Fix EH handling corner case.

* mini.c (create_jit_info): Handle the case where the basic
block right after a try block is dead. For example:
.try {
....
leave ...
}
nop //HERE
.catch {
...
}

The above nop is dead code and the branch opts will nullify it
which caused the code in create_jit_info to assert when
calculating the try block lenght.

This is a very rare case since only obfuscators or broken
compilers would put instruction between the try and handler
blocks.

The fix is to simply iterate over all CIL addresses of the
try block in reverse order looking for the first block which
was not removed.

Fixes 633291
mono/mini/mini.c