Skip to content

Commit bf1a107

Browse files
authored
fixes the low-level Disasm_expert.Basic.create function (#1420)
It was creating an incorrect encoding for instructions, namely `bap:llvm-armv7-` (notice the dangling dash in the end). Also affects the `Disasm_expert.Basic.with_disasm` function.
1 parent 6c1d4c4 commit bf1a107

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/bap_disasm/bap_disasm_basic.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ let lookup target encoding =
618618
| Some create -> create target
619619

620620
let create ?(debug_level=0) ?(cpu="") ?(attrs="") ?(backend="llvm") triple =
621-
let name = String.concat ~sep:"-" [backend; triple; cpu] ^ attrs in
621+
let parts = [backend; triple; cpu] |>
622+
List.filter ~f:(Fn.non String.is_empty) in
623+
let name = String.concat ~sep:"-" parts ^ attrs in
622624
match Hashtbl.find disassemblers name with
623625
| Some d ->
624626
d.users <- d.users + 1;

0 commit comments

Comments
 (0)