diff --git a/ChangeLog b/ChangeLog index 0a6fa04ce..336bf07c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-02-07 Paulo Andrade + + * lib/jit_size.c: Preventively use at least 144 bytes + if JIT_INSTR_MAX is less than it. The logic is not + guaranteed to be 100% precise, it is mostly heuristics + to allocate a buffer with as close as possible size, + but a wrong value may cause code generation to write + past the end of the buffer. + 2015-02-03 Paulo Andrade * lib/lightning.c: Correct the reason the bug in diff --git a/lib/jit_size.c b/lib/jit_size.c index ae4c633bf..612417e88 100644 --- a/lib/jit_size.c +++ b/lib/jit_size.c @@ -110,7 +110,7 @@ _jit_get_size(jit_state_t *_jit) jit_word_t jit_get_max_instr(void) { - return (JIT_INSTR_MAX); + return (JIT_INSTR_MAX >= 144 ? JIT_INSTR_MAX : 144); } void