Skip to content

Commit a5cf15e

Browse files
authored
HPPA dissassembler fix unitialized variables errors (#2309)
1 parent cda40c6 commit a5cf15e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/HPPA/HPPADisassembler.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ static void fill_spop_mods(uint32_t insn, uint32_t ext, hppa_ext *hppa_ext)
25032503
get_insn_field(insn, 27, 31);
25042504
break;
25052505
default:
2506-
break;
2506+
return;
25072507
}
25082508
push_int_modifier(hppa_ext, sop);
25092509
if (n == 1) {
@@ -2833,7 +2833,7 @@ static bool decode_copr(const cs_struct *ud, MCInst *MI, uint32_t insn)
28332833
->is_alternative = true;
28342834
}
28352835
}
2836-
} else if (class == 3) {
2836+
} else {
28372837
subop = get_insn_field(insn, 16, 18);
28382838
if (subop >= 4) {
28392839
return false;
@@ -2888,7 +2888,7 @@ static bool decode_copr(const cs_struct *ud, MCInst *MI, uint32_t insn)
28882888
default:
28892889
return false;
28902890
}
2891-
} else if (class == 3) {
2891+
} else {
28922892
subop = get_insn_field(insn, 16, 18);
28932893
switch (subop) {
28942894
case 0x00:

cstool/cstool_hppa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ void print_insn_detail_hppa(csh handle, cs_insn *ins)
2121
cs_hppa_op *op = &(hppa->operands[i]);
2222
uint64_t target_addr;
2323
switch (op->type) {
24+
default:
25+
break;
2426
case HPPA_OP_REG:
2527
printf("\t\toperands[%u].type: REG = %s\n", i,
2628
cs_reg_name(handle, op->reg));

0 commit comments

Comments
 (0)