Skip to content

Commit f465492

Browse files
committed
Fix missing operand for smstart, due to space replaced by tab
Fixes capstone-engine#2715.
1 parent f2f0a3c commit f465492

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

arch/AArch64/AArch64Mapping.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static void AArch64_add_not_defined_ops(MCInst *MI, const SStream *OS)
670670
case AARCH64_INS_ALIAS_SMSTART:
671671
case AARCH64_INS_ALIAS_SMSTOP: {
672672
const char *disp_off = NULL;
673-
disp_off = strstr(OS->buffer, " za");
673+
disp_off = strstr(OS->buffer, "smstart\tza");
674674
if (disp_off) {
675675
aarch64_sysop sysop = { 0 };
676676
sysop.alias.svcr = AARCH64_SVCR_SVCRZA;
@@ -679,7 +679,7 @@ static void AArch64_add_not_defined_ops(MCInst *MI, const SStream *OS)
679679
AARCH64_OP_SYSALIAS);
680680
return;
681681
}
682-
disp_off = strstr(OS->buffer, " sm");
682+
disp_off = strstr(OS->buffer, "smstart\tsm");
683683
if (disp_off) {
684684
aarch64_sysop sysop = { 0 };
685685
sysop.alias.svcr = AARCH64_SVCR_SVCRSM;

tests/details/aarch64.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,3 +1505,40 @@ test_cases:
15051505
access: CS_AC_READ
15061506
regs_read: []
15071507
regs_write: []
1508+
-
1509+
input:
1510+
bytes: [0x7f, 0x43, 0x03, 0xd5, 0x7f, 0x45, 0x03, 0xd5, 0x7f, 0x47, 0x03, 0xd5]
1511+
arch: "CS_ARCH_AARCH64"
1512+
options: [ CS_OPT_DETAIL ]
1513+
address: 0x0
1514+
expected:
1515+
insns:
1516+
-
1517+
asm_text: "smstart sm"
1518+
details:
1519+
aarch64:
1520+
operands:
1521+
-
1522+
type: AARCH64_OP_SYSALIAS
1523+
sub_type: AARCH64_OP_SVCR
1524+
sys_raw_val: 0x1
1525+
regs_read: []
1526+
regs_write: []
1527+
-
1528+
asm_text: "smstart za"
1529+
details:
1530+
aarch64:
1531+
operands:
1532+
-
1533+
type: AARCH64_OP_SYSALIAS
1534+
sub_type: AARCH64_OP_SVCR
1535+
sys_raw_val: 0x2
1536+
regs_read: []
1537+
regs_write: []
1538+
-
1539+
asm_text: "smstart"
1540+
details:
1541+
aarch64:
1542+
operands: []
1543+
regs_read: []
1544+
regs_write: []

0 commit comments

Comments
 (0)