Skip to content

Commit

Permalink
[next][SuperH] Fix missing setting detail->sh (#2466)
Browse files Browse the repository at this point in the history
* [next][SuperH] Fix missing setting detail->sh

detail->sh is never set. Which makes the detailed output related to operands is always missing.

Signed-off-by: david942j <[email protected]>

* Fix merge commit

---------

Signed-off-by: david942j <[email protected]>
  • Loading branch information
david942j authored Sep 19, 2024
1 parent 67d9756 commit 10db5f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/SH/SHDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,8 @@ bool SH_getInstruction(csh ud, const uint8_t *code, size_t code_len,
*size = 0;
return MCDisassembler_Fail;
} else {
if (detail)
detail->sh = info->op;
return MCDisassembler_Success;
}
}
Expand Down
22 changes: 22 additions & 0 deletions tests/issues/issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5031,3 +5031,25 @@ test_cases:
vas: AARCH64LAYOUT_VL_D
regs_read: [ za0.d, za1.d, za2.d, za3.d, za4.d, za5.d, za6.d, za7.d ]
groups: [ HasSME ]

-
input:
name: "issue 2424"
bytes: [ 0x32,0x11,0x92,0x00 ]
arch: "CS_ARCH_SH"
options: [ CS_MODE_SH2A, CS_MODE_BIG_ENDIAN, CS_OPT_DETAIL ]
address: 0x0
expected:
insns:
-
asm_text: "movu.w @(1024,r1),r2"
details:
sh:
operands:
-
type: SH_OP_MEM
mem_disp: 0x400
reg: r1
-
type: SH_OP_REG
reg: r2

0 comments on commit 10db5f4

Please sign in to comment.