Skip to content

Commit 1077911

Browse files
bmourad01bmourad01
andauthored
Fix not propagating term attrs in mangle_names during lifting (#1556)
* Fix not propagating term attrs in `mangle_names` during lifting * Fix style * Update testsuite revision Co-authored-by: bmourad01 <[email protected]>
1 parent 4cdae32 commit 1077911

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ testsuite:
5555
git clone https://github.com/BinaryAnalysisPlatform/bap-testsuite.git testsuite
5656

5757
check: testsuite
58-
make REVISION=ddb5e33ce1c -C testsuite
58+
make REVISION=5909f59c5c29a7b143573bd49b8101a68ccded32 -C testsuite
5959

6060
.PHONY: indent check-style status-clean
6161

lib/bap_sema/bap_sema_lift.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,14 @@ let mangle_name addr tid name =
434434

435435
let mangle_sub s =
436436
let tid = Term.tid s in
437-
let addr = Term.get_attr s address in
437+
let attrs = Term.attrs s in
438+
let addr = Dict.find attrs address in
438439
let name = mangle_name addr tid (Ir_sub.name s) in
439440
set_name_if_possible tid name >>| fun () ->
440-
Ir_sub.create () ~tid ~name
441-
~args:(Term.enum arg_t s |> Seq.to_list)
442-
~blks:(Term.enum blk_t s |> Seq.to_list)
441+
let s = Ir_sub.create () ~tid ~name
442+
~args:(Term.enum arg_t s |> Seq.to_list)
443+
~blks:(Term.enum blk_t s |> Seq.to_list) in
444+
Term.with_attrs s attrs
443445

444446
let fix_names prog =
445447
let is_new tid name =

0 commit comments

Comments
 (0)