Hi Mikhail, You wrote:
I like the idea of simplification which you pointed, but I think this approach is not quite correct in general: the dead code might be in the try block. In this case stackmap locals at the dead block should be assignable to stackmap at the handler_pc instruction. In other words, if catch block accesses locals defined before the try block and this try block has a dead code, then stackmap for the dead code can't have empty locals: otherwise Java6 verification would fail I am not sure I understand the problem. Assume you "nop" all instructions in the dead block and finalize it with an "athrow". According to the Java 6 verification rules, the only thing you need is a [][java/lang/Throwable] StackMap. This is because (from the verification algorithm): 1. A nop instruction is always type safe. The nop instruction does not affect the type state 2. An athrow instruction is type safe iff the top of the operand stack matches Throwable The verifier cannot (and will not) check the consistency of this block with other blocks because this block in unreachable. It will also not check the consistency of this block with "applicable" exception handlers because it does not perform this check for "nop" and "athrow" instructions. Thanks, Asaf __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
