提交 ab2b9f17 编写于 作者: M Michael Walle

lm32-dis: fix NULL pointer dereference

Signed-off-by: NMichael Walle <michael@walle.cc>
上级 b92e062a
......@@ -303,11 +303,11 @@ int print_insn_lm32(bfd_vma memaddr, struct disassemble_info *info)
}
case 'c': {
uint8_t csr;
const char *csr_name;
const Lm32CsrInfo *info;
csr = (op >> 21) & 0x1f;
csr_name = find_csr_info(csr)->name;
if (csr_name) {
fprintf_fn(stream, "%s", csr_name);
info = find_csr_info(csr);
if (info) {
fprintf_fn(stream, "%s", info->name);
} else {
fprintf_fn(stream, "0x%x", csr);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册