disassembly: fix access to undefined memory pointer upon unknown instruction
return error message instead. Found by clang. Change-Id: Ica109d077206236a12d007e77cc78061ffd05834 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/169 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
parent
3bab899063
commit
6fa4c5a456
|
@ -280,13 +280,13 @@ static int evaluate_ldc_stc_mcrr_mrrc(uint32_t opcode,
|
||||||
{
|
{
|
||||||
instruction->type = ARM_MCRR;
|
instruction->type = ARM_MCRR;
|
||||||
mnemonic = "MCRR";
|
mnemonic = "MCRR";
|
||||||
}
|
} else if ((opcode & 0x0ff00000) == 0x0c500000) {
|
||||||
|
/* MRRC */
|
||||||
/* MRRC */
|
|
||||||
if ((opcode & 0x0ff00000) == 0x0c500000)
|
|
||||||
{
|
|
||||||
instruction->type = ARM_MRRC;
|
instruction->type = ARM_MRRC;
|
||||||
mnemonic = "MRRC";
|
mnemonic = "MRRC";
|
||||||
|
} else {
|
||||||
|
LOG_ERROR("Unknown instruction");
|
||||||
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(instruction->text, 128,
|
snprintf(instruction->text, 128,
|
||||||
|
|
Loading…
Reference in New Issue