From c17670fb0c451f4c916cc4ea565c0fa3ae1163e0 Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Thu, 15 Feb 2007 07:31:05 +0000 Subject: [PATCH] compile_block() checks if code cache is full --- ChangeLog | 5 +++++ jit/jit-function.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8832707..640c891 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-14 Aleksey Demakov + + * jit/jit-function.c (compile_block): check if cache is full and + exit if so. + 2007-02-13 Aleksey Demakov * doc/texinfo.tex: remove an ancient file version from the tree. diff --git a/jit/jit-function.c b/jit/jit-function.c index dac32ff..0c0bcfb 100644 --- a/jit/jit-function.c +++ b/jit/jit-function.c @@ -518,6 +518,16 @@ static void compile_block(jit_gencode_t gen, jit_function_t func, printf("Start of binary code: 0x%08x\n", p1); #endif + /* The cache is full. */ + if(!jit_cache_check_for_n(&gen->posn, 1)) + { +#ifdef _JIT_COMPILE_DEBUG + printf("No space left in the code cache.\n\n"); + fflush(stdout); +#endif + return; + } + switch(insn->opcode) { case JIT_OP_NOP: break; /* Ignore NOP's */ -- 2.47.3