From 16384ff2feaeee0ed29d7fd7a58ae1cb6a6c3042 Mon Sep 17 00:00:00 2001 From: pcpa Date: Fri, 4 Apr 2014 19:53:14 -0300 Subject: [PATCH] Correct crash on arm in the doc/printf example. * lib/jit_disasm.c: Correct a crash in the doc/printf example on arm due to releasing the data_info information in jit_clear_state. This is a special case for arm only, and actually, only armv5 or older uses the data_info buffer, or when forcing arm instruction set mode besides thumb available. --- ChangeLog | 9 +++++++++ lib/jit_disasm.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bec7a6af6..f8f6cfdc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-04-04 Paulo Andrade + + * lib/jit_disasm.c: Correct a crash in the doc/printf example + on arm due to releasing the data_info information in + jit_clear_state. This is a special case for arm only, and + actually, only armv5 or older uses the data_info buffer, + or when forcing arm instruction set mode besides thumb + available. + 2014-12-03 Paulo Andrade * doc/body.texi: Write detailed description and examples for diff --git a/lib/jit_disasm.c b/lib/jit_disasm.c index 00cd71c17..a54bc257b 100644 --- a/lib/jit_disasm.c +++ b/lib/jit_disasm.c @@ -294,7 +294,7 @@ _disassemble(jit_state_t *_jit, jit_pointer_t code, jit_int32_t length) char buffer[address_buffer_length]; #if __arm__ - data_info = 1; + data_info = _jitc && _jitc->data_info.ptr; data_offset = 0; #endif disasm_info.buffer = code;