Skip to content

Commit a9e378e

Browse files
authored
restores output for non-empty instructions (#1288)
It looks like that #1281 rendered bap useless for unlifted instructions. Both mc and objdump commads are now outputing empty objects even without asm or opcodes, which makes it really hard to write a new lifter. This PR fixes it on mc and objdump level. I am not sure if we also need this in the disassembler driver (as in any case the output of this driver will be incorrect without having full semantics).
1 parent de0e258 commit a9e378e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugins/mc/mc_main.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,13 @@ let new_insn arch mem insn =
321321
322322
let lift arch mem insn =
323323
match KB.run Theory.Program.cls (new_insn arch mem insn) KB.empty with
324-
| Ok (code,_) -> Ok (KB.Value.get Theory.Semantics.slot code)
325324
| Error conflict -> fail (Inconsistency conflict)
325+
| Ok (code,_) ->
326+
Result.return @@
327+
let sema = KB.Value.get Theory.Semantics.slot code in
328+
if Insn.(equal empty sema)
329+
then Insn.of_basic insn
330+
else sema
326331
327332
let print_insn_size formats mem =
328333
List.iter formats ~f:(fun _fmt ->

0 commit comments

Comments
 (0)