From: Rhys Weatherley Date: Fri, 21 May 2004 22:51:42 +0000 (+0000) Subject: _jit_block_peephole_branch: don't allow conditional branches to cross X-Git-Tag: r.0.0.4~93 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e1bd1891df9888250844d829bd039b673efd60f2;p=francis%2Flibjit.git _jit_block_peephole_branch: don't allow conditional branches to cross an exception context boundary, because doing so will violate "finally" semantics. --- diff --git a/ChangeLog b/ChangeLog index 197a5ee..5434c10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ +2004-05-22 Rhys Weatherley + + * jit/jit-block.c (_jit_block_peephole_branch): don't allow + conditional branches to cross an exception context boundary, + because doing so will violate "finally" semantics. + 2004-05-21 Rhys Weatherley * jit/jit-gen-arm.c, jit/jit-gen-arm.h: modify the ARM codegen diff --git a/jit/jit-block.c b/jit/jit-block.c index abc5b13..9517e0e 100644 --- a/jit/jit-block.c +++ b/jit/jit-block.c @@ -481,6 +481,11 @@ void _jit_block_peephole_branch(jit_block_t block) { break; } + if(new_block->block_eh != block->block_eh && insn->opcode != JIT_OP_BR) + { + /* Conditional branches must never cross an exception context */ + break; + } if(new_block->first_insn < new_block->last_insn) { /* There is more than one instruction in this block,