From: Aleksey Demakov Date: Sun, 28 May 2006 11:11:57 +0000 (+0000) Subject: At the end of initialize setjmp block add a label that is moved along with X-Git-Tag: before.move.to.git~237 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8a8482e496d3404b3fc644886346eced32b340a7;p=francis%2Flibjit.git At the end of initialize setjmp block add a label that is moved along with the block code and use it as the jump target. --- diff --git a/ChangeLog b/ChangeLog index e026743..760f54d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-28 Klaus Treichel + + * jit/jit-insn.c: Add a code_label in initialize_setjmp_block just + before the end_label that is moved with the block to the start of + the function as jump target to the code. Otherwise other blocks + moved to the start after this block will never be executed. + 2006-05-27 Aleksey Demakov * jit/jit-reg-alloc.c (free_value, save_value): the value that has diff --git a/jit/jit-insn.c b/jit/jit-insn.c index e3fc3a4..9e6d42f 100644 --- a/jit/jit-insn.c +++ b/jit/jit-insn.c @@ -7000,6 +7000,7 @@ static int initialize_setjmp_block(jit_function_t func) #if !defined(JIT_BACKEND_INTERP) jit_label_t start_label = jit_label_undefined; jit_label_t end_label = jit_label_undefined; + jit_label_t code_label = jit_label_undefined; jit_label_t rethrow_label = jit_label_undefined; jit_type_t type; jit_value_t args[2]; @@ -7105,7 +7106,7 @@ static int initialize_setjmp_block(jit_function_t func) #endif /* !HAVE_SIGSETJMP */ /* Branch to the end of the init code if "setjmp" returned zero */ - if(!jit_insn_branch_if_not(func, value, &end_label)) + if(!jit_insn_branch_if_not(func, value, &code_label)) { return 0; } @@ -7176,6 +7177,12 @@ static int initialize_setjmp_block(jit_function_t func) JIT_CALL_NOTHROW | JIT_CALL_NORETURN); jit_type_free(type); + /* Insert the target to jump to the normal code. */ + if(!jit_insn_label(func, &code_label)) + { + return 0; + } + /* Force the start of a new block to mark the end of the init code */ if(!jit_insn_label(func, &end_label)) {