]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
_jit_block_peephole_branch: don't allow conditional branches to cross
authorRhys Weatherley <rweather@southern-storm.com.au>
Fri, 21 May 2004 22:51:42 +0000 (22:51 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Fri, 21 May 2004 22:51:42 +0000 (22:51 +0000)
an exception context boundary, because doing so will violate "finally"
semantics.

ChangeLog
jit/jit-block.c

index 197a5ee44cb70e16107bef6d1da0d35b11dbf14a..5434c108c59ce3e3dee370a40f7d80ecc5b22da9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 
+2004-05-22  Rhys Weatherley  <rweather@southern-storm.com.au>
+
+       * 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  <rweather@southern-storm.com.au>
 
        * jit/jit-gen-arm.c, jit/jit-gen-arm.h: modify the ARM codegen
index abc5b1362ddf1a5316bc72f9d11c7a22c0229071..9517e0ec4d95ef7a6e759f853b95cf945f0774ba 100644 (file)
@@ -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,