Skip to content

Commit

Permalink
Fix #2381
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Sep 10, 2024
1 parent 6a7fef6 commit f9ebb0c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,13 @@ void map_set_is_alias_insn(MCInst *MI, bool Val, uint64_t Alias) {
MI->flat_insn->alias_id = Alias;
}

static inline bool char_ends_mnem(const char c) {
return (!c || c == ' ' || c == '\t');
static inline bool char_ends_mnem(const char c, cs_arch arch) {
switch (arch) {
default:
return (!c || c == ' ' || c == '\t' || c == '.');
case CS_ARCH_PPC:
return (!c || c == ' ' || c == '\t');
}
}

/// Sets an alternative id for some instruction.
Expand All @@ -393,7 +398,7 @@ void map_set_alias_id(MCInst *MI, const SStream *O, const name_map *alias_mnem_i
++i;
}
for (; j < sizeof(alias_mnem) - 1; ++j, ++i) {
if (char_ends_mnem(asm_str_buf[i]))
if (char_ends_mnem(asm_str_buf[i], MI->csh->arch))
break;
alias_mnem[j] = asm_str_buf[i];
}
Expand Down

0 comments on commit f9ebb0c

Please sign in to comment.