Skip to content

Commit e5799bc

Browse files
committed
Work around old LibraryFunctions spawning even with sem.unknown_function.spawn disabled
1 parent 3c35b20 commit e5799bc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/analyses/base.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,11 @@ struct
24182418
in
24192419
List.filter_map (create_thread (Some (Mem id, NoOffset)) (Some ptc_arg)) start_funvars_with_unknown
24202420
end
2421-
| _, _ ->
2421+
| _, _ when get_bool "sem.unknown_function.spawn" ->
2422+
(* TODO: Remove sem.unknown_function.spawn check because it is (and should be) really done in LibraryFunctions.
2423+
But here we consider all non-ThreadCrate functions also unknown, so old-style LibraryFunctions access
2424+
definitions using `Write would still spawn because they are not truly unknown functions (missing from LibraryFunctions).
2425+
Need this to not have memmove spawn in SV-COMP. *)
24222426
let shallow_args = LibraryDesc.Accesses.find desc.accs { kind = Spawn; deep = false } args in
24232427
let deep_args = LibraryDesc.Accesses.find desc.accs { kind = Spawn; deep = true } args in
24242428
let shallow_flist = collect_invalidate ~deep:false (Analyses.ask_of_ctx ctx) ctx.global ctx.local shallow_args in
@@ -2427,6 +2431,7 @@ struct
24272431
let addrs = List.concat_map AD.to_var_may flist in
24282432
if addrs <> [] then M.debug ~category:Analyzer "Spawning functions from unknown function: %a" (d_list ", " d_varinfo) addrs;
24292433
List.filter_map (create_thread None None) addrs
2434+
| _, _ -> []
24302435

24312436
let assert_fn ctx e refine =
24322437
(* make the state meet the assertion in the rest of the code *)

0 commit comments

Comments
 (0)