mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
target/xtensa: disas/xtensa: fix coverity warnings
Coverity warnings CID 1385146, 1385148 1385149 and 1385150 point that xtensa_opcode_num_operands and xtensa_format_num_slots may return -1 even when xtensa_opcode_decode and xtensa_format_decode succeed. In that case unsigned counters used to iterate through operands/slots will not do the right thing. Make counters and loop bounds signed to fix the warnings. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
parent
251634f4ce
commit
847a647320
2 changed files with 4 additions and 4 deletions
|
@ -37,7 +37,7 @@ int print_insn_xtensa(bfd_vma memaddr, struct disassemble_info *info)
|
|||
bfd_byte *buffer = g_malloc(1);
|
||||
int status = info->read_memory_func(memaddr, buffer, 1, info);
|
||||
xtensa_format fmt;
|
||||
unsigned slot, slots;
|
||||
int slot, slots;
|
||||
unsigned len;
|
||||
|
||||
if (status) {
|
||||
|
@ -79,7 +79,7 @@ int print_insn_xtensa(bfd_vma memaddr, struct disassemble_info *info)
|
|||
|
||||
for (slot = 0; slot < slots; ++slot) {
|
||||
xtensa_opcode opc;
|
||||
unsigned opnd, vopnd, opnds;
|
||||
int opnd, vopnd, opnds;
|
||||
|
||||
if (slot) {
|
||||
info->fprintf_func(info->stream, "; ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue