Fix invalid comparison with HPPA_OP_INVALID (#2300)

This commit is contained in:
R3v0LT 2024-03-29 11:46:00 +03:00 committed by GitHub
parent 9daa1ffbac
commit cda40c6537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6 additions and 6 deletions

View File

@ -609,7 +609,7 @@ static void print_operand(MCInst *MI, SStream *O, const cs_hppa_op *op)
break;
case HPPA_OP_MEM:
SStream_concat(O, "(");
if (op->mem.space != HPPA_OP_INVALID &&
if (op->mem.space != HPPA_REG_INVALID &&
op->mem.space != HPPA_REG_SR0) {
SStream_concat(O, HPPA_reg_name((csh)MI->csh,
op->mem.space));

View File

@ -419,7 +419,7 @@ void HPPA_reg_access(const cs_insn *insn, cs_regs regs_read,
}
break;
case HPPA_OP_MEM:
if (op->mem.space != HPPA_OP_INVALID)
if (op->mem.space != HPPA_REG_INVALID)
regs_read[read_count++] = op->mem.space;
if (op->mem.base_access & CS_AC_READ) {
regs_read[read_count++] = op->mem.base;

View File

@ -42,7 +42,7 @@ def print_insn_detail(insn):
print("\t\toperands[%u].type: DISP = 0x%s" % (c, to_x(i.imm)))
if i.type == HPPA_OP_MEM:
print("\t\toperands[%u].type: MEM" % c)
if i.mem.space != HPPA_OP_INVALID:
if i.mem.space != HPPA_REG_INVALID:
print("\t\t\toperands[%u].mem.space: REG = %s" % (c, insn.reg_name(i.mem.space)))
print("\t\t\toperands[%u].mem.base: REG = %s" % (c, insn.reg_name(i.mem.base)))
if i.type == HPPA_OP_TARGET:

View File

@ -51,7 +51,7 @@ void print_insn_detail_hppa(csh handle, cs_insn *ins)
break;
case HPPA_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i);
if (op->mem.space != HPPA_OP_INVALID) {
if (op->mem.space != HPPA_REG_INVALID) {
printf("\t\t\toperands[%u].mem.space: REG = %s\n",
i, cs_reg_name(handle, op->mem.space));
}

View File

@ -48,7 +48,7 @@ char *get_detail_hppa(csh *p_handle, cs_mode mode, cs_insn *ins)
break;
case HPPA_OP_MEM:
add_str(&result, "\t\toperands[%u].type: MEM\n", i);
if (op->mem.space != HPPA_OP_INVALID) {
if (op->mem.space != HPPA_REG_INVALID) {
add_str(&result,
"\t\t\toperands[%u].mem.space: REG = %s\n",
i, cs_reg_name(handle, op->mem.space));

View File

@ -64,7 +64,7 @@ static void print_insn_detail(cs_insn *ins)
break;
case HPPA_OP_MEM:
printf("\t\toperands[%u].type: MEM\n", i);
if (op->mem.space != HPPA_OP_INVALID) {
if (op->mem.space != HPPA_REG_INVALID) {
printf("\t\t\toperands[%u].mem.space: REG = %s\n",
i, cs_reg_name(handle, op->mem.space));
}