Skip to content

Commit

Permalink
Simplify Fun.flip invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Feb 18, 2025
1 parent c13bcc3 commit 3c4f6cc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/analyses/malloc_null.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct
let return_addr () = !return_addr_

let return man (exp:exp option) (f:fundec) : D.t =
let remove_var x v = List.fold_left (Fun.flip @@ D.remove) x (to_addrs v) in
let remove_var x v = List.fold_left (Fun.flip D.remove) x (to_addrs v) in
let nst = List.fold_left remove_var man.local (f.slocals @ f.sformals) in
match exp with
| Some ret ->
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/region.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct
| Queries.Regions e ->
let regpart = man.global () in
if is_bullet e regpart man.local then Queries.Result.bot q (* TODO: remove bot *) else
let ls = List.fold_left (Fun.flip @@ Queries.LS.add) (Queries.LS.empty ()) (regions e regpart man.local) in
let ls = List.fold_left (Fun.flip Queries.LS.add) (Queries.LS.empty ()) (regions e regpart man.local) in
ls
| _ -> Queries.Result.top q

Expand Down
2 changes: 1 addition & 1 deletion src/analyses/symbLocks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct
let assign man lval rval = invalidate_lval (Analyses.ask_of_man man) lval man.local

let return man exp fundec =
let rm list acc = List.fold_left (Fun.flip @@ D.remove_var) acc list in
let rm list acc = List.fold_left (Fun.flip D.remove_var) acc list in
rm fundec.slocals (rm fundec.sformals man.local)

let enter man lval f args = [(man.local,man.local)]
Expand Down
2 changes: 1 addition & 1 deletion src/util/library/libraryFunctions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ let reset_lazy () =
ResettableLazy.reset activated_library_descs

let lib_funs = ref (Set.String.of_list ["__raw_read_unlock"; "__raw_write_unlock"; "spin_trylock"])
let add_lib_funs funs = lib_funs := List.fold_left (Fun.flip @@ Set.String.add) !lib_funs funs
let add_lib_funs funs = lib_funs := List.fold_left (Fun.flip Set.String.add) !lib_funs funs
let use_special fn_name = Set.String.mem fn_name !lib_funs

let kernel_safe_uncalled = Set.String.of_list ["__inittest"; "init_module"; "__exittest"; "cleanup_module"]
Expand Down

0 comments on commit 3c4f6cc

Please sign in to comment.