Skip to content

Commit

Permalink
ThreadAnalysis: Handle pthread_exit like return from thread.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerhard committed Nov 21, 2023
1 parent 2fef812 commit 645b03c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/analyses/threadAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct
module P = IdentityP (D)

(* transfer functions *)
let return ctx (exp:exp option) (f:fundec) : D.t =
let return ctx (exp:exp option) _ : D.t =
let tid = ThreadId.get_current (Analyses.ask_of_ctx ctx) in
begin match tid with
| `Lifted tid -> ctx.sideg tid (false, TS.bot (), not (D.is_empty ctx.local))
Expand Down Expand Up @@ -64,6 +64,8 @@ struct
| [t] -> join_thread ctx.local t (* single thread *)
| _ -> ctx.local (* if several possible threads are may-joined, none are must-joined *)
| exception SetDomain.Unsupported _ -> ctx.local)
| ThreadExit { ret_val } ->
return ctx (Some ret_val) ()
| _ -> ctx.local

let query ctx (type a) (q: a Queries.t): a Queries.result =
Expand Down

0 comments on commit 645b03c

Please sign in to comment.